fix(lsp): improve isServerInstalled for custom server configs (#282)
This commit is contained in:
@@ -163,6 +163,12 @@ export function isServerInstalled(command: string[]): boolean {
|
|||||||
if (command.length === 0) return false
|
if (command.length === 0) return false
|
||||||
|
|
||||||
const cmd = command[0]
|
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 isWindows = process.platform === "win32"
|
||||||
const ext = isWindows ? ".exe" : ""
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user