summaryrefslogtreecommitdiff
path: root/cli/lsp/config.rs
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-10-14 23:04:38 +1100
committerGitHub <noreply@github.com>2022-10-14 23:04:38 +1100
commitafcea6c233dad9b1c3e8202b950d38bf0c472c40 (patch)
treef017e443e1ac7f9b40a6a5cbe1b5f7fd949fbfc4 /cli/lsp/config.rs
parente6e28981909f220ff0b98a13c692c0203eaf6035 (diff)
fix(lsp): properly handle snippets on completions (#16274)
Fixes #15367
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r--cli/lsp/config.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs
index 27f52653d..98ba5afb5 100644
--- a/cli/lsp/config.rs
+++ b/cli/lsp/config.rs
@@ -20,6 +20,7 @@ pub const SETTINGS_SECTION: &str = "deno";
pub struct ClientCapabilities {
pub code_action_disabled_support: bool,
pub line_folding_only: bool,
+ pub snippet_support: bool,
pub status_notification: bool,
/// The client provides the `experimental.testingApi` capability, which is
/// built around VSCode's testing API. It indicates that the server should
@@ -393,6 +394,16 @@ impl Config {
.as_ref()
.and_then(|it| it.disabled_support)
.unwrap_or(false);
+ self.client_capabilities.snippet_support =
+ if let Some(completion) = &text_document.completion {
+ completion
+ .completion_item
+ .as_ref()
+ .and_then(|it| it.snippet_support)
+ .unwrap_or(false)
+ } else {
+ false
+ };
}
}