-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Lazy fixes resolving #6466
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
Lazy fixes resolving #6466
Conversation
This comment has been minimized.
This comment has been minimized.
Good catch! fixed. |
|
I think this moves roughly in the right direction, but I think the specifics of API should be different. Specifically, I think this should be close to how code action works.
|
|
So, I htink we should add something along this lines |
|
I think I got the idea. I will try to implement it in the suggested way, but unfortunately I'm currently a bit overwhelmed with my main job, thus cannot provide any guarantees on how long it will take. |
|
Unfortunately, it doesn't seem that I'll be able to work on the rust analyzer at least 'till the end of the year. Since this PR doesn't provide a proper fix, I'm closing it to not provide a stale entry in the list. |
|
No worries, I’ll look into this soon-ish :)
Thanks formally your awesome contributions, and we’ll be waiting for you
next year ;-)
…On Saturday, 21 November 2020, Igor Aleksanov ***@***.***> wrote:
Unfortunately, it doesn't seem that I'll be able to work on the rust
analyzer at least 'till the end of the year.
Since this PR doesn't provide a proper fix, I'm closing it to not provide
a stale entry in the list.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6466 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M4Z5DRFUJ2IOK64GRTSQ6CHJANCNFSM4TKDHHKA>
.
|
Resolves #6433
Currently, fixes for diagnostics are resolved eagerly, which is not quite a good idea: when we collect diagnostics, we report all of them to user.
Fixes though are reported only if cursor is within the fix trigger range, otherwise they're just skipped.
Given the fact that resolving a fix may be an expensive operation (incorrect case diagnostic is a good example: in order to provide fix, we must track all the places where diagnostic is used), doing it just to be rejected because of cursor position is incorrect.
What this PR does: instead of providing a full fix, only the trigger range is provided by default. And only if
rust-analyzersees that fix exists and its range is suitable, it will try to resolve the fix.@matklad I feel weird about
Analysis::with_semanticsmethod and having to callparsemanually in themissing_record_expr_field_fix. It just doesn't feel right. Could you please tell whether the direction is at least correct?Also, unfortunately I'm not able to reproduce the issue even with 1ms auto-save enabled, thus will be grateful if someone will check whether this fix works or not. In theory it should, but who knows.
cc @neilyoung @lnicola