Skip to content

Commit 2c8d42d

Browse files
committed
roll back vtsls
1 parent 9c237f0 commit 2c8d42d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/opencode/src/lsp/server.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@ export namespace LSPServer {
8282

8383
export const Typescript: Info = {
8484
id: "typescript",
85-
root: NearestRoot(
86-
["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"],
87-
["deno.json", "deno.jsonc"],
88-
),
85+
root: NearestRoot(["tsconfig.json", "package.json", "jsconfig.json", ".git"], ["deno.json", "deno.jsonc"]),
8986
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],
9087
async spawn(root) {
91-
const proc = spawn(BunProc.which(), ["x", "@vtsls/language-server", "--stdio"], {
88+
const tsserver = await Bun.resolve("typescript/lib/tsserver.js", root).catch(() => {})
89+
if (!tsserver) return
90+
const proc = spawn(BunProc.which(), ["x", "typescript-language-server", "--stdio"], {
9291
cwd: root,
9392
env: {
9493
...process.env,
@@ -97,6 +96,11 @@ export namespace LSPServer {
9796
})
9897
return {
9998
process: proc,
99+
initialization: {
100+
tsserver: {
101+
path: tsserver,
102+
},
103+
},
100104
}
101105
},
102106
}

0 commit comments

Comments
 (0)