clickhouse/typescript-lsp
> Use the TypeScript language server (`typescript-language-server`) for precise references, hover (type signatures and JSDoc, including `@deprecated` info), workspace-wide symbol search, completions, and per-file type diagnostics. Prefer this over grep when you need to resolve a symbol's actual definition, find all usages of an exported API, or inspect inferred types across the `packages/*` workspaces. The server is preinstalled as a root devDependency — run the repository `setup` skill (`npm install`) first so `node_modules` is populated. Do NOT use this skill for downstream projects that merely depend on `@clickhouse/client`; it is specific to working inside this repo.
npx skills add https://github.com/ClickHouse/clickhouse-js --skill typescript-lsp
typescript-language-server is declared as a root devDependency, so after
npm install (see the setup skill) it is available via npx and uses the
workspace-local typescript (6.x) compiler, matching CI exactly.
From the repo root:
npx typescript-language-server --stdio
It speaks LSP (JSON-RPC, Content-Length-framed) over stdio. There is no
extra configuration: each packages/* workspace, tests/clickhouse-test-runner,
examples/node, and examples/web has its own tsconfig.json, and the
server picks the nearest one per opened file automatically.
initialize with rootUri/workspaceFolders pointing at the reporoot, then the initialized notification.
textDocument/didOpen with the full file text for every file youwant to query (the server reads dependencies from disk on its own; only
files you query positions in need to be opened).
| Request | Notes |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| textDocument/hover | Returns the full inferred signature + JSDoc markdown |
| textDocument/definition | Resolves across workspace packages via source, not dist/ |
| textDocument/references | Within the opened file's project |
| workspace/symbol | e.g. query ClickHouseClient finds class + re-exports |
| textDocument/completion | Context-aware member completions |
| Diagnostics | Push only (textDocument/publishDiagnostics notifications, sent ~1–3s after didOpen). The pull textDocument/diagnostic request is _not_ supported (-32601) — wait for the push notification instead. |
it at npx typescript-language-server --stdio with the repo root as the
workspace folder.
with Content-Length: <bytes>\r\n\r\n<json>, and match responses by id.
npm run build && npm run typecheck(build first — some workspaces import compiled dist/ outputs); the LSP is
for targeted, interactive queries, not for CI-equivalent validation.
Take clickhouse/typescript-lsp from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm, npx.
Without those the skill loads but fails at the first command.