Proxies typescript-language-server over HTTP. One server per workspace. Handles .ts, .tsx, .js, .jsx, .mjs, .cjs.
npm i -g typescript-language-server typescriptVerify: typescript-language-server --version (should print semver e.g. 5.1.3).
tsconfig.jsonpackage.json
ts-direct start # cwd walk-up
ts-direct call textDocument/documentSymbol \
'{"textDocument":{"uri":"file:///abs/path/to/file.ts"}}'
ts-direct call textDocument/references \
'{"textDocument":{"uri":"file:///abs/path/to/file.ts"},
"position":{"line":20,"character":10},
"context":{"includeDeclaration":true}}'
ts-direct call workspace/symbol '{"query":"UserStore"}'Every standard LSP 3.17 method typescript-language-server implements, plus tsserver-specific commands via workspace/executeCommand.
- rootUri must not be null:
typescript-language-serverrejects null rootUri at init.lsp-stdio-proxy.jsalways sets it from--workspace, so this is transparent when invoked viats-direct. - Monorepo tsconfig selection: walk-up stops at the FIRST
tsconfig.json. In a monorepo with nested packages (packages/foo/tsconfig.json,packages/bar/tsconfig.json, plus a roottsconfig.json), starting frompackages/foo/src/pickspackages/foo/tsconfig.json. Start from the repo root to pick the root tsconfig. - Tsserver plugins:
typescript-language-serverdoes not load tsserver plugins fromtsconfig.json compilerOptions.pluginsunless explicitly configured viainitializationOptions.plugins. If you need a plugin (e.g. styled-components, graphql), extend the spawn call ints-director open an issue. - Memory: on large monorepos tsserver can consume 2-4GB.
lsp-stdio-proxy.jsdoes not passmaxTsServerMemoryby default — add it viainitializationOptionsif you hit OOM.
- Cold: 0.2-1s (tsserver init + tsconfig load)
- Warm: ~70ms per call
~/.cache/ts-direct/<workspace-hash>/{pid,port,workspace,log}