-
Notifications
You must be signed in to change notification settings - Fork 770
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
[READY] Rust analyzer code action fixes #1771
[READY] Rust analyzer code action fixes #1771
Conversation
dace0ca
to
68840b4
Compare
Let's wait on rust-lang/rust-analyzer#18589 so we don't have to introduce new hacks. |
e3d7b40
to
2594df3
Compare
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.
Reviewed 5 of 7 files at r1, 1 of 2 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
ycmd/tests/rust/get_completions_proc_macro_test.py
line 75 at r2 (raw file):
for candidate in results: if candidate[ 'insertion_text' ] == 'checkpoint': checked_candidate = candidate
break?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1771 +/- ##
==========================================
+ Coverage 95.51% 95.91% +0.40%
==========================================
Files 52 84 +32
Lines 6975 8469 +1494
Branches 0 163 +163
==========================================
+ Hits 6662 8123 +1461
+ Misses 313 296 -17
- Partials 0 50 +50 |
2594df3
to
b96501f
Compare
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.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @puremourning)
ycmd/tests/rust/get_completions_proc_macro_test.py
line 75 at r2 (raw file):
Previously, puremourning (Ben Jackson) wrote…
break?
Done.
The protocol expects us to call `codeAction/resolve` whenever a codeaction lacks either an `edit` or a `command`. Code action literals can lack the `data` field, which some servers (hint: rust-analyzer) require to respond to `codeAction/resolve`. However, we can still apply such code actions, so we do.
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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
Thanks for sending a PR! |
New rust-analyzer, with the following changes:
completionItem/resolve
requests, but does not advertise that server capability.1.1. Link: internal: Send less data during
textDocument/completion
if possible rust-lang/rust-analyzer#18167 (comment)codeAction/resolve
request.2.1. Link: codeAction/resolve throws an exception for a code action without
data
rust-lang/rust-analyzer#184282.2. This is what the added test exercises.
This change is