дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 01:57:13 +02:00
fix(tools): offer an IDE copy only for a tool found on PATH
An executable chosen in settings wins over the IDE's own copy, so its install button stays a plain Install.
Цей коміт міститься в:
1 джерело
1d9759dda7
коміт
3fe3088bc8
2 files changed
+30
-3
No files matched your search
@@ -435,9 +435,9 @@ function ToolDetails({ tool, language, pending }: { tool: ToolInfo; language: st
|
||||
? tx("Update")
|
||||
: tool.status === "installed"
|
||||
? tx("Reinstall")
|
||||
: tool.status === "missing"
|
||||
? tx("Install")
|
||||
: tx("Install IDE Copy")}
|
||||
: tool.status === "onPath"
|
||||
? tx("Install IDE Copy")
|
||||
: tx("Install")}
|
||||
</Button>
|
||||
)}
|
||||
{tool.canUninstall && (
|
||||
|
||||
@@ -472,6 +472,33 @@ describe("LanguageServersPage", () => {
|
||||
expect(screen.queryByRole("button", { name: /^Install Missing/ })).toBeNull();
|
||||
});
|
||||
|
||||
it("offers an IDE copy only for a tool found on PATH", async () => {
|
||||
backend.tools.push({
|
||||
...sampleTools().find((t) => t.name === "gopls")!,
|
||||
name: "golangci-lint-langserver",
|
||||
displayName: "golangci-lint-langserver",
|
||||
status: "custom",
|
||||
path: "/opt/bin/golangci-lint-langserver",
|
||||
});
|
||||
const user = userEvent.setup();
|
||||
renderPage();
|
||||
await open(user, "TypeScript");
|
||||
await user.click(toolItem("typescript-language-server"));
|
||||
const onPath = within(screen.getByLabelText("typescript-language-server details")).getByRole("button", {
|
||||
name: "Install typescript-language-server",
|
||||
});
|
||||
expect(onPath).toHaveTextContent("Install IDE Copy");
|
||||
expect(onPath).toHaveAttribute("title", expect.stringContaining("/opt/homebrew/bin/typescript-language-server"));
|
||||
// The executable chosen in settings wins over an IDE copy, so it is a plain Install.
|
||||
await open(user, "Go");
|
||||
await user.click(toolItem("golangci-lint-langserver"));
|
||||
expect(
|
||||
within(screen.getByLabelText("golangci-lint-langserver details")).getByRole("button", {
|
||||
name: "Install golangci-lint-langserver",
|
||||
}),
|
||||
).toHaveTextContent(/^Install$/);
|
||||
});
|
||||
|
||||
it("notes the other languages a shared tool serves", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderPage();
|
||||
|
||||
Reference in new issue
Заблокувати користувача