这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@liam923
Copy link
Contributor

@liam923 liam923 commented Oct 16, 2024

Currently, the occurrences query ignores identifiers if their location is "ghost". This causes issues with finding occurrences in the presence of let punning. Also, this probably produces some undesirable behavior in the presence of ppxs (occurrences within ppx-generated code will be ignored). This PR changes occurrences to instead ignore identifiers whose location is Location.none.

This PR also causes the occurrences query to begin filtering occurrences read from an index file. This goes in hand with this flambda PR, which causes occurrences in cmt/cms files to not be pre-filtered. Before, flambda also filtered "ghost" locations when producing cmt/cms files. Now, it will do no filtering, leaving the onus on Merlin.

Because of this, one of the tests introduced by this PR is left unfixed - it will be corrected once the flambda PR is merged. I've made a separate draft PR (#109) that contains the changes from this PR, but it is based on the flambda version that contains the relevant patch. In that draft PR, the test is corrected and passing.

@liam923
Copy link
Contributor Author

liam923 commented Oct 17, 2024

I'm converting this to a draft PR for now because I realized some other changes are also necessary.

@liam923 liam923 marked this pull request as draft October 17, 2024 15:34
@liam923 liam923 marked this pull request as ready for review October 17, 2024 17:09
@liam923
Copy link
Contributor Author

liam923 commented Oct 17, 2024

This PR is ready for review again.

@goldfirere
Copy link
Contributor

Holding off on further review pending oxcaml/oxcaml#3137

@liam923
Copy link
Contributor Author

liam923 commented Oct 23, 2024

This is now ready for any further necessary review

@liam923 liam923 merged commit 3c27607 into main Oct 24, 2024
1 of 2 checks passed
@liam923 liam923 deleted the let-pun-occurrences branch October 24, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants