aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-31 02:26:20 +0000
committerBlaž Hrastnik2023-03-31 06:19:36 +0000
commit9fe3adcff9866ef18953a067fbc0b84e7eb968b5 (patch)
tree067f52b556165bc462cca1fdc48e959f697638b5 /helix-view/src
parenta48d1a4abc0d23d6bc3cfda714d87b9fa4484da8 (diff)
add option to enable/disable lsp snippets
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 `{}` {{ {} }}",