From 278b24389457e33791d394dd9a8a93740e2cc099 Mon Sep 17 00:00:00 2001 From: Em Zhan Date: Sun, 28 Jun 2026 21:46:57 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=9A=A0=20indicator=20not=20showing=20i?= =?UTF-8?q?f=20LSPs=20would=20start=20(#15909)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helix-term/src/handlers/workspace_trust.rs | 6 +----- helix-term/src/ui/editor.rs | 2 +- helix-view/src/document.rs | 6 ++++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/helix-term/src/handlers/workspace_trust.rs b/helix-term/src/handlers/workspace_trust.rs index b0bcdc59..31d3d364 100644 --- a/helix-term/src/handlers/workspace_trust.rs +++ b/helix-term/src/handlers/workspace_trust.rs @@ -24,11 +24,7 @@ pub(super) fn register_hooks(_handlers: &Handlers) { let (workspace, servers_to_load) = { let doc = doc!(event.editor, &doc_id); - let servers_to_load = doc - .language_config() - .map(|lang| !lang.language_servers.is_empty() || lang.debugger.is_some()) - .unwrap_or(false); - (doc.workspace_root().to_path_buf(), servers_to_load) + (doc.workspace_root().to_path_buf(), doc.servers_to_load()) }; // Stale: `.helix/` was edited since the user last ran `trust`. LSPs keep diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 5127a7be..3bd66f94 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1175,7 +1175,7 @@ fn workspace_trust_indicator_visible(editor: &Editor) -> bool { let (_, doc) = helix_view::current_ref!(editor); editor .workspace_trust - .workspace_restricted(doc.workspace_root()) + .restricted_for_doc(doc.workspace_root(), doc.servers_to_load()) } impl EditorView { diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index 311188eb..72aa97f9 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1979,6 +1979,12 @@ impl Document { self.language_servers().any(|l| l.id() == id) } + pub fn servers_to_load(&self) -> bool { + self.language_config() + .map(|lang| !lang.language_servers.is_empty() || lang.debugger.is_some()) + .unwrap_or(false) + } + pub fn diff_handle(&self) -> Option<&DiffHandle> { self.diff_handle.as_ref() } -- 2.51.2