-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Auto-imports not working in Kate #18363
Comments
It seems I have the same problem using Emacs + rustic + lsp (latest Doom Emacs, to be exact). |
Same here, using vanilla Emacs from |
Automatically adding imports is broken in Emacs + lsp-mode on I bisected the problem to commit 950bb83 ("Resolve completion items"). Reverting that commit on top of This was part of PR: Testing procedure: Open a file in Emacs, start LSP, and type: fn main() {
let x: Pin// Wait, then select `Pin<..> (use std::pin::Pin) (Struct)`.
} At and after commit 950bb83, this does not cause |
So, Kate (and others) seem to declare something in their client completion resolve capabilities, that they are not able to resolve, presumably To quote the spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion
So, if your editor declares a completion resolve support for the A proper fix seems to come over each client's completion resolve capabilities and remove the |
Filed for visibility over on the lsp-mode side here: |
Ok, so it is indeed a bug in r-a as it seems. diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs
index d546dfd424..b9bed7ae50 100644
--- a/crates/rust-analyzer/src/handlers/request.rs
+++ b/crates/rust-analyzer/src/handlers/request.rs
@@ -1143,7 +1143,7 @@ pub(crate) fn handle_completion_resolve(
let Some(mut resolved_completion) = resolved_completions.into_iter().find(|completion| {
completion.label == original_completion.label
&& completion.kind == original_completion.kind
- && completion.deprecated == original_completion.deprecated
+ // && completion.deprecated == original_completion.deprecated
&& completion.preselect == original_completion.preselect
&& completion.sort_text == original_completion.sort_text
}) else {
Certain editors want to resolve tags and this was written incorrectly. I'm not sure that it's all though, as the whole "find the item with the same label and search score" is bad and there has to be a better id-like thing we could check. |
A more proper solution #18503 still feels somewhat fragile but much better the current one. |
Is this related to recent completion issues in Zed? I meant to file an issue over at zed-industries/zed last week but traced it back to rust-analyzer sending the wrong completion in |
Yes, that morbid |
Seems to work with HomeBrew's rust-analyzer 2024-11-17. |
So, seems that both Emacs and Kate issues were fixed and this can be closed. |
rust-analyzer version: rust-analyzer 1 (9323b53 2024-10-20)
rustc version: rustc 1.84.0-nightly (662180b34 2024-10-20)
editor or extension: Kate 24.08.2 on Arch linux
Auto-imports not working in Kate
Downgrading to rust-analyzer 2024-09-30 fixes it. In versions after that nothing happens.
The text was updated successfully, but these errors were encountered: