-
Notifications
You must be signed in to change notification settings - Fork 821
Checker: report environment before checking namespace #18609
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
Conversation
❗ Release notes required
|
bcad6fa
to
cb8e4e9
Compare
It turns out the same captured environments are used in different kinds of features, even though their requirements are different:
These requirements contradict each other. Previously we ignored some of the related small bugs here and there, and #18519 was an attempt at fixing some of them. What can be done here is one these options:
It's likely that all of these approaches will require fixing features that (accidentally) rely on the current behavior. It may also turn out to be more work to do it consistently across different kinds of declarations. |
There's another interesting detail. Features like tooltips try to get previously reported symbols at the given range first, so sticking with environments tailored for code completion may be a good (and simple!) approach after all. The reason some of the FCS tests fail is they provide incorrect arguments like the line text or coordinates, which happened to work with the previous implementation (which seems incorrect). Let's see what does CI say for the rest of the tests. |
Yay, it's green 🙂 |
Thanks @auduchinok for the detailed analysis and targeted fix here! |
A follow up for #18519.
It turns out features like the code completion relied on the own environment being reported when checking top level declarations in some cases. This is not an entirely correct approach, but it's likely that there are many similar places where things assumed something close enough being reported.
#18519 has broken cases where a name resolution environment just before checking a namespace was lost (i.e. including previously checked namespaces). This PR adds reporting the environment before checking the current namespace fragment. This may break some other things but it seems it's a step in the right direction.