Skip to content

Commit 501a253

Browse files
committed
revert ts lsp to monorepo root
1 parent 6a9856d commit 501a253

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

bun.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"dependencies": {
6464
"@aws-sdk/client-s3": "3.933.0",
6565
"@opencode-ai/script": "workspace:*",
66-
"@opencode-ai/sdk": "workspace:*"
66+
"@opencode-ai/sdk": "workspace:*",
67+
"typescript": "catalog:"
6768
},
6869
"repository": {
6970
"type": "git",

packages/opencode/src/lsp/server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ export namespace LSPServer {
8282

8383
export const Typescript: Info = {
8484
id: "typescript",
85-
root: NearestRoot(["tsconfig.json", "package.json", "jsconfig.json", ".git"], ["deno.json", "deno.jsonc"]),
85+
root: NearestRoot(
86+
["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"],
87+
["deno.json", "deno.jsonc"],
88+
),
8689
extensions: [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"],
8790
async spawn(root) {
88-
const tsserver = await Bun.resolve("typescript/lib/tsserver.js", root).catch(() => {})
91+
const tsserver = await Bun.resolve("typescript/lib/tsserver.js", Instance.directory).catch(() => {})
92+
log.info("typescript server", { tsserver })
8993
if (!tsserver) return
9094
const proc = spawn(BunProc.which(), ["x", "typescript-language-server", "--stdio"], {
9195
cwd: root,

0 commit comments

Comments
 (0)