-
Notifications
You must be signed in to change notification settings - Fork 13.4k
WIP: Suggest similar type or module on resolve failure #68850
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Seems like a good idea. |
This comment has been minimized.
This comment has been minimized.
Retriggering a build, as the PR build failed due to a network issue. |
Nice, this closes one of the remaining items in #30197 (comment) ("Add levenshtein distance based suggestions everywhere"), the "segments in path prefixes" one. |
ScopeSet::AbsolutePath(TypeNS), | ||
parent_scope, | ||
ident, | ||
&|_| true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use is_expected
from PathSource::Type
.
In general, this whole logic should mirror lookup_typo_candidate
from fn smart_resolve_report_errors
.
When failing to resolve types or modules, this change tries to provide a suggestion with similarly named candidates.
d696477
to
3c6a203
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@petrochenkov Thanks for your help so far! I'm currently not quite sure if I'm going in the right direction with this: In order to call |
Oh. You need a late resolution visitor for the non-early |
[triage] This PR's status wasn't updated in two weeks or more, if it isn't updated in two more weeks the PR will be closed due to inactivity. |
When failing to resolve types or modules, this change tries to provide a
suggestion with similarly named candidates.
If desired, I can try and move some of the diagnostics code in
resolve/lib.rs
toresolve/diagnostics.rs
as it seems to accumulate a bit in lib.rs.Fixes #56982