The open source coding agent.
TypeScript
switch to vtsls for typescript lsp
Dax Raadb16aa81e0d2c
diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.tsindex af96a02d81b..44752fd504d 100644--- a/packages/opencode/src/lsp/server.ts+++ b/packages/opencode/src/lsp/server.ts@@ -82,12 +82,13 @@ export namespace LSPServer {export const Typescript: Info = {id: "typescript",- root: NearestRoot(["tsconfig.json", "package.json", "jsconfig.json", ".git"], ["deno.json", "deno.jsonc"]),+ root: NearestRoot(+ ["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"],+ ["deno.json", "deno.jsonc"],+ ),extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],async spawn(root) {- const tsserver = await Bun.resolve("typescript/lib/tsserver.js", root).catch(() => {})- if (!tsserver) return- const proc = spawn(BunProc.which(), ["x", "typescript-language-server", "--stdio"], {+ const proc = spawn(BunProc.which(), ["x", "@vtsls/language-server", "--stdio"], {cwd: root,env: {...process.env,@@ -96,11 +97,6 @@ export namespace LSPServer {})return {process: proc,- initialization: {- tsserver: {- path: tsserver,- },- },}},}