aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r--helix-lsp/src/lib.rs25
1 files changed, 20 insertions, 5 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index d56148a4..c3a5d816 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -647,6 +647,7 @@ impl Registry {
language_config: &LanguageConfiguration,
doc_path: Option<&std::path::PathBuf>,
root_dirs: &[PathBuf],
+ enable_snippets: bool,
) -> Result<Option<Arc<Client>>> {
let config = match &language_config.language_server {
Some(config) => config,
@@ -661,8 +662,14 @@ impl Registry {
// initialize a new client
let id = self.counter.fetch_add(1, Ordering::Relaxed);
- let NewClientResult(client, incoming) =
- start_client(id, language_config, config, doc_path, root_dirs)?;
+ let NewClientResult(client, incoming) = start_client(
+ id,
+ language_config,
+ config,
+ doc_path,
+ root_dirs,
+ enable_snippets,
+ )?;
self.incoming.push(UnboundedReceiverStream::new(incoming));
let old_clients = entry.insert(vec![(id, client.clone())]);
@@ -695,6 +702,7 @@ impl Registry {
language_config: &LanguageConfiguration,
doc_path: Option<&std::path::PathBuf>,
root_dirs: &[PathBuf],
+ enable_snippets: bool,
) -> Result<Option<Arc<Client>>> {
let config = match &language_config.language_server {
Some(config) => config,
@@ -711,8 +719,14 @@ impl Registry {
// initialize a new client
let id = self.counter.fetch_add(1, Ordering::Relaxed);
- let NewClientResult(client, incoming) =
- start_client(id, language_config, config, doc_path, root_dirs)?;
+ let NewClientResult(client, incoming) = start_client(
+ id,
+ language_config,
+ config,
+ doc_path,
+ root_dirs,
+ enable_snippets,
+ )?;
clients.push((id, client.clone()));
self.incoming.push(UnboundedReceiverStream::new(incoming));
Ok(Some(client))
@@ -811,6 +825,7 @@ fn start_client(
ls_config: &LanguageServerConfiguration,
doc_path: Option<&std::path::PathBuf>,
root_dirs: &[PathBuf],
+ enable_snippets: bool,
) -> Result<NewClientResult> {
let (client, incoming, initialize_notify) = Client::start(
&ls_config.command,
@@ -834,7 +849,7 @@ fn start_client(
.capabilities
.get_or_try_init(|| {
_client
- .initialize()
+ .initialize(enable_snippets)
.map_ok(|response| response.capabilities)
})
.await;