fix LSP ComplitionTriggerKind value for TriggerKind::Auto (#9660)

This commit is contained in:
nkitsaini 2024-02-19 18:28:17 +05:30 committed by GitHub
parent ebf155d635
commit 787cc36092
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -221,9 +221,17 @@ fn request_completion(
.iter() .iter()
.find(|&trigger| trigger_text.ends_with(trigger)) .find(|&trigger| trigger_text.ends_with(trigger))
}); });
lsp::CompletionContext {
trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER, if trigger_char.is_some() {
trigger_character: trigger_char.cloned(), lsp::CompletionContext {
trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER,
trigger_character: trigger_char.cloned(),
}
} else {
lsp::CompletionContext {
trigger_kind: lsp::CompletionTriggerKind::INVOKED,
trigger_character: None,
}
} }
}; };