-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: locations integrity check tool #505
Comments
I didn't think about it when reviewing #504 but we indeed have something like this in the codebase already, see It's disabled by default but you can enable it by passing Let me know if that fits your needs! I'll refactor the tests for your migration fix to use this instead! |
😮 wow, TIL. Thanks! |
For reference, to get this to work you need to pass both |
I noticed :) thanks for the heads up! |
I opened a PR with a fix: #506 I'll include this in the next release! |
Merlin expects locations to be well-formed. The only reference to what "well-formed" means that I could find is here: ocaml/ocaml#8987. Copying for posterity:
I wonder if ppxlib could include a
check_locations_integrity
tool to check the locations of a given AST to make sure they comply with these rules. This tool would be useful for both ppxlib maintainers and the larger ecosystem of ppx authors alike.As an example, right now in reason-react we have to analyze full trees of AST nodes doing this work manually, which is very time consuming.
See related: #503 and its fix #504 where a small subset of what this tool could look like is implemented.
The text was updated successfully, but these errors were encountered: