fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.2k stars 739 forks source link

Fix node range handling in Hermes parser adapter #589

Closed motiz88 closed 3 years ago

motiz88 commented 3 years ago

Quick follow up from #504 fixing location handling with the Hermes parser. Adds a nodeToRange method supporting the two different AST formats generated by hermes-parser, as well as matching locationProps.

Test plan:

  1. Ensure that "Hide location data" works for both babel: false and babel: true.
  2. Ensure that hovering a node highlights the corresponding code for both babel: false and babel: true.
motiz88 commented 3 years ago

CI seems to be having unrelated difficulties, but for some reason I can't login to restart the job.

motiz88 commented 3 years ago

@fkling friendly ping! Sorry for missing this issue in the initial Hermes PR.

fkling commented 3 years ago

No problem :)