diff options
| author | Aiden Cline <[email protected]> | 2025-08-25 23:11:38 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-25 23:11:38 -0500 |
| commit | cb03655aacb6459bbc4637d9fcb1b6c35133091b (patch) | |
| tree | ac95bc372949e376e60cc9866e929802ee473919 | |
| parent | 012a292948094a403a1d2deb7ab689a8980a06e2 (diff) | |
| download | opencode-cb03655aacb6459bbc4637d9fcb1b6c35133091b.tar.gz opencode-cb03655aacb6459bbc4637d9fcb1b6c35133091b.zip | |
fix: eslint ENOTEMPTY (#2252)
| -rw-r--r-- | packages/opencode/src/lsp/index.ts | 1 | ||||
| -rw-r--r-- | packages/opencode/src/lsp/server.ts | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/packages/opencode/src/lsp/index.ts b/packages/opencode/src/lsp/index.ts index 3703284e7..678f60218 100644 --- a/packages/opencode/src/lsp/index.ts +++ b/packages/opencode/src/lsp/index.ts @@ -140,6 +140,7 @@ export namespace LSP { s.broken.add(root + server.id) handle.process.kill() log.error(`Failed to initialize LSP client ${server.id}`, { error: err }) + return undefined }) if (!client) continue s.clients.push(client) diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index 46c52ec45..2636df967 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -148,6 +148,7 @@ export namespace LSPServer { async spawn(app, root) { const eslint = await Bun.resolve("eslint", app.path.cwd).catch(() => {}) if (!eslint) return + log.info("spawning eslint server") const serverPath = path.join(Global.Path.bin, "vscode-eslint", "server", "out", "eslintServer.js") if (!(await Bun.file(serverPath).exists())) { if (Flag.OPENCODE_DISABLE_LSP_DOWNLOAD) return @@ -164,7 +165,9 @@ export namespace LSPServer { const extractedPath = path.join(Global.Path.bin, "vscode-eslint-main") const finalPath = path.join(Global.Path.bin, "vscode-eslint") - if (await Bun.file(finalPath).exists()) { + const stats = await fs.stat(finalPath).catch(() => undefined) + if (stats) { + log.info("removing old eslint installation", { path: finalPath }) await fs.rm(finalPath, { force: true, recursive: true }) } await fs.rename(extractedPath, finalPath) |
