aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs26
1 files changed, 25 insertions, 1 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 2c72686d..ca55151a 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1371,13 +1371,16 @@ fn lsp_restart(
return Ok(());
}
+ let editor_config = cx.editor.config.load();
let (_view, doc) = current!(cx.editor);
let config = doc
.language_config()
.context("LSP not defined for the current document")?;
let scope = config.scope.clone();
- cx.editor.language_servers.restart(config, doc.path())?;
+ cx.editor
+ .language_servers
+ .restart(config, doc.path(), &editor_config.workspace_lsp_roots)?;
// This collect is needed because refresh_language_server would need to re-borrow editor.
let document_ids_to_refresh: Vec<DocumentId> = cx
@@ -1970,6 +1973,20 @@ fn open_config(
Ok(())
}
+fn open_workspace_config(
+ cx: &mut compositor::Context,
+ _args: &[Cow<str>],
+ event: PromptEvent,
+) -> anyhow::Result<()> {
+ if event != PromptEvent::Validate {
+ return Ok(());
+ }
+
+ cx.editor
+ .open(&helix_loader::workspace_config_file(), Action::Replace)?;
+ Ok(())
+}
+
fn open_log(
cx: &mut compositor::Context,
_args: &[Cow<str>],
@@ -2647,6 +2664,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
signature: CommandSignature::none(),
},
TypableCommand {
+ name: "config-open-workspace",
+ aliases: &[],
+ doc: "Open the workspace config.toml file.",
+ fun: open_workspace_config,
+ signature: CommandSignature::none(),
+ },
+ TypableCommand {
name: "log-open",
aliases: &[],
doc: "Open the helix log file.",