fix(lsp): MEMORY LEAK: ensure typescript server uses native project config (#19953)

This commit is contained in:
Derek Barrera
2026-04-06 09:50:36 -04:00
committed by GitHub
parent 517e6c9aa4
commit 01f0319192
3 changed files with 91 additions and 1 deletions

View File

@@ -105,7 +105,17 @@ export namespace LSPServer {
if (!tsserver) return
const bin = await Npm.which("typescript-language-server")
if (!bin) return
const proc = spawn(bin, ["--stdio"], {
const args = ["--stdio", "--tsserver-log-verbosity", "off", "--tsserver-path", tsserver]
if (
!(await pathExists(path.join(root, "tsconfig.json"))) &&
!(await pathExists(path.join(root, "jsconfig.json")))
) {
args.push("--ignore-node-modules")
}
const proc = spawn(bin, args, {
cwd: root,
env: {
...process.env,