mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
switch typescript lsp to be one per package to ensure it loads when typescript is not installed at root
This commit is contained in:
parent
69c2dd53ad
commit
e8db95be16
1 changed files with 2 additions and 5 deletions
|
|
@ -82,13 +82,10 @@ export namespace LSPServer {
|
|||
|
||||
export const Typescript: Info = {
|
||||
id: "typescript",
|
||||
root: NearestRoot(
|
||||
["package-lock.json", "bun.lockb", "bun.lock", "pnpm-lock.yaml", "yarn.lock"],
|
||||
["deno.json", "deno.jsonc"],
|
||||
),
|
||||
root: NearestRoot(["tsconfig.json", "package.json", "jsconfig.json", ".git"], ["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", Instance.directory).catch(() => {})
|
||||
const tsserver = await Bun.resolve("typescript/lib/tsserver.js", root).catch(() => {})
|
||||
if (!tsserver) return
|
||||
const proc = spawn(BunProc.which(), ["x", "typescript-language-server", "--stdio"], {
|
||||
cwd: root,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue