Skip to content

Commit e2fed14

Browse files
committed
Fix: Auto import has broken for vim-lsp
1. Thanks for ShoyuVanilla`s advise, I try to fix this bug by Temporarily disable completion resolve support like Neovim and helix. close the bug #19401
1 parent a6c1fa0 commit e2fed14

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ impl Config {
15491549
limit: self.completion_limit(source_root).to_owned(),
15501550
enable_term_search: self.completion_termSearch_enable(source_root).to_owned(),
15511551
term_search_fuel: self.completion_termSearch_fuel(source_root).to_owned() as u64,
1552-
fields_to_resolve: if self.client_is_neovim() {
1552+
fields_to_resolve: if self.client_is_neovim() || self.client_is_vim_lsp() {
15531553
CompletionFieldsToResolve::empty()
15541554
} else {
15551555
CompletionFieldsToResolve::from_client_capabilities(&client_capability_fields)
@@ -2362,6 +2362,10 @@ impl Config {
23622362
pub fn client_is_neovim(&self) -> bool {
23632363
self.client_info.as_ref().map(|it| it.name == "Neovim").unwrap_or_default()
23642364
}
2365+
2366+
pub fn client_is_vim_lsp(&self) -> bool {
2367+
self.client_info.as_ref().map(|it| it.name == "vim-lsp").unwrap_or_default()
2368+
}
23652369
}
23662370
// Deserialization definitions
23672371

crates/rust-analyzer/src/lsp/capabilities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn server_capabilities(config: &Config) -> ServerCapabilities {
4141
})),
4242
hover_provider: Some(HoverProviderCapability::Simple(true)),
4343
completion_provider: Some(CompletionOptions {
44-
resolve_provider: if config.client_is_neovim() {
44+
resolve_provider: if config.client_is_neovim() || config.client_is_vim_lsp() {
4545
config.completion_item_edit_resolve().then_some(true)
4646
} else {
4747
Some(config.caps().completions_resolve_provider())

0 commit comments

Comments
 (0)