@@ -1354,6 +1354,37 @@ fn lsp_restart(
1358+ cx: &mut compositor::Context,
1359+ _args: &[Cow<str>],
1360+ event: PromptEvent,
1361+) -> anyhow::Result<()> {
1362+ if event != PromptEvent::Validate {
1366+ let doc = doc!(cx.editor);
1371+ .context("LSP not running for the current document")?;
1375+ .context("LSP not defined for the current document")?;
1376+ cx.editor.language_servers.stop(config);
1378+ for doc in cx.editor.documents_mut() {
1379+ if doc.language_server().map_or(false, |ls| ls.id() == ls_id) {
1380+ doc.set_language_server(None);
1381+ doc.set_diagnostics(Default::default());
1357fn tree_sitter_scopes(
1388fn tree_sitter_scopes(
1358 cx: &mut compositor::Context,
1389 cx: &mut compositor::Context,
1359 _args: &[Cow<str>],
1390 _args: &[Cow<str>],
@@ -2349,6 +2380,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
2349 fun: lsp_restart,
2380 fun: lsp_restart,
2350 completer: None,
2381 completer: None,
2386+ doc: "Stops the Language Server that is in use by the current doc",
2352 TypableCommand {
2390 TypableCommand {
2353 name: "tree-sitter-scopes",
2391 name: "tree-sitter-scopes",
2354 aliases: &[],
2392 aliases: &[],