From 88d4f71aaab975a227e05261f46d75cc153587de Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Fri, 6 Nov 2026 00:27:55 +0800 Subject: [PATCH] fix(plugins): explain how to approve a process program installed after its grant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A process: permission allowed while its program was missing has no pinned binary, so the plugin keeps failing after the program is installed and the IDE restarts. The error now says the program must be on PATH and that the permission has to be cleared and selected again in Settings › Plugins. --- crates/ide-host/src/plugins/api.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ide-host/src/plugins/api.rs b/crates/ide-host/src/plugins/api.rs index a09e61a1..7c3d2b45 100644 --- a/crates/ide-host/src/plugins/api.rs +++ b/crates/ide-host/src/plugins/api.rs @@ -306,8 +306,9 @@ impl PluginApi { // allowed, and installing it later approves nothing by itself. let pin = self.shared.pins.read().get(&(self.id().to_owned(), cap.clone())).cloned().ok_or_else(|| { HostError::Failed(format!( - "{cap}: `{program}` was not found when this permission was allowed; \ - install it, then allow {cap} again in Settings › Plugins" + "{cap}: `{program}` was not found on PATH when this permission was allowed. \ + Restarting doesn't approve a program installed later: once `{program}` is on PATH, \ + clear {cap} in Settings › Plugins and select it again" )) })?; pin.verify().map(Path::to_path_buf).map_err(|e| HostError::Denied(format!("{cap}: {e}"))) @@ -831,7 +832,8 @@ mod tests { // Allowed while the program was missing: say how to fix it rather than "not granted". let err = api.approved_program("lint").unwrap_err().to_string(); assert!( - err.contains("was not found when this permission was allowed") && err.contains("allow process:lint again"), + err.contains("was not found on PATH when this permission was allowed") + && err.contains("clear process:lint in Settings › Plugins and select it again"), "{err}" );