Skip to content
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

Ignore dummy ranges in id info table. #3231

Closed
wants to merge 4 commits into from

Conversation

gebner
Copy link
Contributor

@gebner gebner commented Apr 3, 2024

@nikswamy
Copy link
Collaborator

Looking into this a bit.

I don't understand how this change could fix the behavior reported in the Pulse issue.

If we enter a symbol in the id_info_table with range = dummyRange, then unless the IDE issues a lookup request with a range equal to the dummy file, with row 0, and some column, I would expect FStar.TypeChecker.Common.id_info_at_pos to return None.

Thereafter, QueryHelper.symlookup should fall back and rely on info_of_lid_str to lookup the symbol in the environment rather than the id_info_table and this could succeed, though it is possible that this returns a symbol with the dummyRange.

So, while I think this change is ok and in fact preferable to not enter symbols with the dummyRange in the id_info_table, I'm not sure this will actually fix the symptom you're observing. Do you think it does? Can you explain why?

@gebner
Copy link
Contributor Author

gebner commented Apr 25, 2024

Yeah, you're completely right. I'm not sure why I thought the issue went away with this patch.

Part of my confusion is that the range contains two ranges: the range of the use site, as well as the range of the definition site. My intention was to ignore id infos where the definition site is a dummy range. But on second thought this would also throw away useful information (the fully-qualified identifier). The check as implemented in this PR compares both ranges though, which indeed doesn't do anything useful.

I have added a small test case in the fstar-vscode-assistant issue. After some more investigation, I believe that this is a general issue with spliced definitions. The sigelt view doesn't contain ranges, so splices are not required to set it. (And there doesn't seem to be an exposed function to set ranges either.)

@gebner gebner closed this Apr 25, 2024
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.

Go-to-definition in Pulse DSL sometimes goes to dummy file
3 participants