aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/editor.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 727e1261..34c59b9b 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -352,6 +352,8 @@ pub struct LspConfig {
pub display_signature_help_docs: bool,
/// Display inlay hints
pub display_inlay_hints: bool,
+ /// Whether to enable snippet support
+ pub snippets: bool,
}
impl Default for LspConfig {
@@ -362,6 +364,7 @@ impl Default for LspConfig {
auto_signature_help: true,
display_signature_help_docs: true,
display_inlay_hints: false,
+ snippets: true,
}
}
}
@@ -1092,12 +1095,13 @@ impl Editor {
// if doc doesn't have a URL it's a scratch buffer, ignore it
let doc = self.document(doc_id)?;
let (lang, path) = (doc.language.clone(), doc.path().cloned());
- let root_dirs = &doc.config.load().workspace_lsp_roots;
+ let config = doc.config.load();
+ let root_dirs = &config.workspace_lsp_roots;
// try to find a language server based on the language name
let language_server = lang.as_ref().and_then(|language| {
self.language_servers
- .get(language, path.as_ref(), root_dirs)
+ .get(language, path.as_ref(), root_dirs, config.lsp.snippets)
.map_err(|e| {
log::error!(
"Failed to initialize the LSP for `{}` {{ {} }}",