fix(lsp): improve isServerInstalled for custom server configs (#282)

This commit is contained in:
adam2am
2025-12-28 17:22:38 -08:00
committed by GitHub
parent 6dd98254be
commit c01b21d0f8

View File

@@ -163,6 +163,12 @@ export function isServerInstalled(command: string[]): boolean {
if (command.length === 0) return false
const cmd = command[0]
// Support absolute paths (e.g., C:\Users\...\server.exe or /usr/local/bin/server)
if (cmd.includes("/") || cmd.includes("\\")) {
if (existsSync(cmd)) return true
}
const isWindows = process.platform === "win32"
const ext = isWindows ? ".exe" : ""
@@ -192,6 +198,11 @@ export function isServerInstalled(command: string[]): boolean {
}
}
// Runtime wrappers (bun/node) are always available in oh-my-opencode context
if (cmd === "bun" || cmd === "node") {
return true
}
return false
}