Fix some LSP bugs causing code actions to not show up correctly#1805
Fix some LSP bugs causing code actions to not show up correctly#1805dzhou121 merged 5 commits intolapce:masterfrom
Conversation
|
Wait what, why'd clippy fail here but not on my local PC? |
Codecov Report
@@ Coverage Diff @@
## master #1805 +/- ##
======================================
Coverage 6.39% 6.40%
======================================
Files 128 128
Lines 55350 55330 -20
======================================
Hits 3542 3542
+ Misses 51808 51788 -20
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| ); | ||
| } | ||
| // REMOVED(if) this prevents some code actions from showing up correctly, and there is almost no performance penalty for this | ||
| //if self.doc.code_actions.get(&prev_offset).is_none() { |
There was a problem hiding this comment.
Does this make it not work properly?
There was a problem hiding this comment.
The if-statement causes some delayed code actions to be left out, causing some quick fixes to not appear. REMOVED(if) is just the reason why it was removed and what was removed, in this case an if statement.
There was a problem hiding this comment.
Is there any way I can test the delayed code actions bit?
There was a problem hiding this comment.
Take this rust code:
fn main() {
let x = 0;
x = 1;
println!(x);
}There are two errors here. Open quick fixes on the variable name, there will be no fix. Now you fix the println one, which has a higher internal priority in RA. Save the file. The bug happens when you open quick fixes on the variable name again, even after you have now fixed the println one and it shows a new error.
There is a "consider making this binding mutable" in the error dialog, but not in the quick fixes.
There was a problem hiding this comment.
The same goes for code actions on code modified after caching, which is even easier to encounter.
CHANGELOG.mdif this change could be valuable to usersThis will fix the following LSP-related issues:
This PR updates the capabilities and code action requests to fully match LSP spec.