{"record":{"id":"6e98534924714ae7","repo":"slint-ui/slint","slug":"could-not-locate-the-configured-slint-lsp-server-binary-in","errorCode":null,"errorMessage":"Could not locate the configured slint-lsp server binary in PATH","messagePattern":"Could not locate the configured slint-lsp server binary in PATH","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"editors/vscode/src/extension.ts","lineNumber":156,"sourceCode":"    if (path.isAbsolute(lsp_binary_path)) {\n        // The slint-lsp override is a absolute path: Look in that path only\n        if (existsSync(lsp_binary_path)) {\n            return lsp_binary_path;\n        }\n        console.warn(\n            \"Could not locate the configured slint-lsp server binary at absolute path\",\n        );\n        return undefined;\n    }\n\n    // The slint-lsp override is a relative path: Look relative to PATH\n    const path_env = process.env.PATH?.split(path.delimiter).map((p) =>\n        path.join(p, lsp_binary_path),\n    );\n\n    const serverModule = path_env?.find((path) => existsSync(path));\n    if (serverModule === undefined) {\n        console.warn(\n            \"Could not locate the configured slint-lsp server binary in PATH\",\n        );\n    }\n    return serverModule;\n}\n\n// Please add changes to the BaseLanguageClient via\n// `client.add_updater((cl: BaseLanguageClient | null): void)`\n//\n// That makes sure the code is run even when the LSP gets restarted, etc.\n//\n// Please add setup common between web and native VSCode by adding updaters\n// to the client in common.ts!\nfunction startClient(\n    client: common.ClientHandle,\n    context: vscode.ExtensionContext,\n    telemetryLogger: vscode.TelemetryLogger,\n) {","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/editors/vscode/src/extension.ts#L138-L174","documentation":"For a relative (non-absolute) slint-lsp binary override, find_lsp_binary joins the configured name against every entry of the PATH environment variable and checks each candidate with existsSync. When no PATH directory contains the binary, it warns 'Could not locate the configured slint-lsp server binary in PATH' and returns undefined. The extension then starts without LSP features.","triggerScenarios":"The slint.lsp binary override is a bare command name (e.g. 'slint-lsp') that is not installed in any PATH directory, or the binary was installed into a directory not present in the PATH of the process running VS Code.","commonSituations":"Installing slint-lsp via cargo install but ~/.cargo/bin missing from the GUI-launched VS Code's PATH; using a custom name for a script that lives outside PATH; PATH differences between terminal and desktop-launched VS Code.","solutions":["Install slint-lsp into a PATH directory (e.g. cargo install slint-lsp, ensuring ~/.cargo/bin is on PATH)","Add the binary's directory to PATH and restart VS Code from that environment","Change the override setting to an absolute path to bypass PATH lookup","Verify with 'which slint-lsp' (using the same environment VS Code inherits)"],"exampleFix":"// shell before\n$ export PATH=$PATH:/home/me/slint/target/debug   # binary not there\n// after — ensure the directory actually holding slint-lsp is on PATH\n$ export PATH=$PATH:/home/me/.cargo/bin && code .","handlingStrategy":"validation","validationCode":"function slintLspOnPath(name) {\n  return (process.env.PATH ?? '').split(path.delimiter).some(dir => existsSync(path.join(dir, name)));\n}\nif (!slintLspOnPath('slint-lsp')) console.warn('slint-lsp not on PATH; install with cargo install slint-lsp');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure ~/.cargo/bin (or the binary's dir) is on PATH for GUI-launched apps","Launch VS Code from a shell that has the right PATH, or set it in launchctl/systemd env","Test with 'which slint-lsp' in the same environment VS Code inherits","Fall back to an absolute-path override when PATH is unreliable"],"tags":["vscode","lsp","path","environment"],"backgroundTag":"command-not-found","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}