From 787cc36092a5d1a575697287d1d6ba08336a8a96 Mon Sep 17 00:00:00 2001 From: nkitsaini Date: Mon, 19 Feb 2024 18:28:17 +0530 Subject: fix LSP ComplitionTriggerKind value for `TriggerKind::Auto` (#9660) --- helix-term/src/handlers/completion.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/handlers/completion.rs b/helix-term/src/handlers/completion.rs index d71fd24f..491ca563 100644 --- a/helix-term/src/handlers/completion.rs +++ b/helix-term/src/handlers/completion.rs @@ -221,9 +221,17 @@ fn request_completion( .iter() .find(|&trigger| trigger_text.ends_with(trigger)) }); - lsp::CompletionContext { - trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER, - trigger_character: trigger_char.cloned(), + + if trigger_char.is_some() { + lsp::CompletionContext { + trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER, + trigger_character: trigger_char.cloned(), + } + } else { + lsp::CompletionContext { + trigger_kind: lsp::CompletionTriggerKind::INVOKED, + trigger_character: None, + } } }; -- cgit v1.2.3-70-g09d2