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

pull/9666/head
nkitsaini 9 months ago committed by GitHub
parent ebf155d635
commit 787cc36092
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -221,10 +221,18 @@ fn request_completion(
.iter() .iter()
.find(|&trigger| trigger_text.ends_with(trigger)) .find(|&trigger| trigger_text.ends_with(trigger))
}); });
if trigger_char.is_some() {
lsp::CompletionContext { lsp::CompletionContext {
trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER, trigger_kind: lsp::CompletionTriggerKind::TRIGGER_CHARACTER,
trigger_character: trigger_char.cloned(), trigger_character: trigger_char.cloned(),
} }
} else {
lsp::CompletionContext {
trigger_kind: lsp::CompletionTriggerKind::INVOKED,
trigger_character: None,
}
}
}; };
let completion_response = ls.completion(doc_id, pos, None, context).unwrap(); let completion_response = ls.completion(doc_id, pos, None, context).unwrap();

Loading…
Cancel
Save