diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-12-06 17:10:24 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-12-06 17:37:39 +0100 |
| commit | 78496f845d198f79d546365445e904ad4e50f95c (patch) | |
| tree | 3f2dac89b01428be05e6fa341092b2a30358364c | |
| parent | 29a66316ad6e86568e120153e60362d563ed8ae9 (diff) | |
| download | rust-78496f845d198f79d546365445e904ad4e50f95c.tar.gz rust-78496f845d198f79d546365445e904ad4e50f95c.zip | |
Temporarily disable completion resolve support for neovim
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs | 6 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs index a4f9246a587..dd7351bcf26 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -1455,7 +1455,7 @@ impl Config { limit: self.completion_limit(source_root).to_owned(), enable_term_search: self.completion_termSearch_enable(source_root).to_owned(), term_search_fuel: self.completion_termSearch_fuel(source_root).to_owned() as u64, - fields_to_resolve: if self.client_is_helix() { + fields_to_resolve: if self.client_is_helix() || self.client_is_neovim() { CompletionFieldsToResolve::empty() } else { CompletionFieldsToResolve::from_client_capabilities(&client_capability_fields) @@ -2183,6 +2183,10 @@ impl Config { pub fn client_is_helix(&self) -> bool { self.client_info.as_ref().map(|it| it.name == "helix").unwrap_or_default() } + + pub fn client_is_neovim(&self) -> bool { + self.client_info.as_ref().map(|it| it.name == "Neovim").unwrap_or_default() + } } // Deserialization definitions diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs index 03628212094..6d73319e67b 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs @@ -41,8 +41,8 @@ pub fn server_capabilities(config: &Config) -> ServerCapabilities { })), hover_provider: Some(HoverProviderCapability::Simple(true)), completion_provider: Some(CompletionOptions { - resolve_provider: if config.client_is_helix() { - None + resolve_provider: if config.client_is_helix() || config.client_is_neovim() { + config.completion_item_edit_resolve().then_some(true) } else { Some(config.caps().completions_resolve_provider()) }, |
