From dd4d3325d4c05b72dd19e0bb38796a8d9783e021 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 25 Nov 2026 07:35:32 +0800 Subject: [PATCH] fix(tools): Install on a tool without an installer opens the settings page on that tool (#5710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Install in the Language Servers popup or an install notification, for a server the IDE can't install itself, opened Settings › Language Servers on the first language, away from the manual install command. It now opens the page on that tool (languages.servers#). --- src/features/tools/__tests__/tools.test.tsx | 5 +++-- src/features/tools/index.ts | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/features/tools/__tests__/tools.test.tsx b/src/features/tools/__tests__/tools.test.tsx index 82d305fd52..45277081a7 100644 --- a/src/features/tools/__tests__/tools.test.tsx +++ b/src/features/tools/__tests__/tools.test.tsx @@ -597,7 +597,7 @@ describe("LanguageServersPage", () => { }); describe("tools.install action", () => { - it("installs installable tools and opens the page for the rest", async () => { + it("installs installable tools and opens the page on the rest", async () => { const { executeAction, registerAction } = await import("@/platform/actions"); const { activate } = await import("../index"); const opened: unknown[] = []; @@ -614,7 +614,8 @@ describe("tools.install action", () => { expect(useTools.getState().tools.find((t) => t.name === "gopls")?.status).toBe("installed"); expect(opened).toEqual([]); await executeAction("tools.install", "solargraph"); - expect(opened).toEqual(["languages.servers"]); + // Opened on that tool, where its manual install hint is. + expect(opened).toEqual(["languages.servers#solargraph"]); } finally { disposers.reverse().forEach((d) => d()); } diff --git a/src/features/tools/index.ts b/src/features/tools/index.ts index 4c1fee6fc3..1ba5fd447b 100644 --- a/src/features/tools/index.ts +++ b/src/features/tools/index.ts @@ -69,7 +69,11 @@ export function activate(): () => void { return; } } - await executeAction("file.settings", SETTINGS_PAGE_ID); + // Opened on that tool, where its manual install hint is. + await executeAction( + "file.settings", + typeof arg === "string" ? `${SETTINGS_PAGE_ID}#${arg}` : SETTINGS_PAGE_ID, + ); }, }, ]),