Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DON'T LAND
The idea with this PR is to save a def for every element of a path (we currently know this in name resolution but don't save it). Then we can save it in save-analysis and in an IDE we will be able to jump from the prefix segments of a path to their definition (which is a glaring omission in the RLS right now).
Obviously this is missing the save-analysis parts.
However, I am stuck because the compiler is panicking when bootstrapping std. I'm getting
path resolved multiple times
from here. From backtraces this is happening when resolving imports, (finalize_import
is in the backtrace). However, it looks like that is only called once, fromresolve_crate
, and I think that is the only time I would record the path segments (i.e., I wouldn't when callingresolve_import
becauserecord_used
isfalse
).So, questions - am I doing anything stupid here which I shouldn't be doing at all or should be doing differently? Or do you know/can you see any way which we could be resolving the path segments more than once?
cc @petrochenkov @eddyb @jseyfried