Skip to content

rx-language-server: find a hoisted TypeScript - #7

Draft
oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-tsdk-parents
Draft

oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-tsdk-parents

Conversation

@oddcelot

@oddcelot oddcelot commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to solidjs#92.

In a workspace that hoists node_modules to a parent folder, Zed uses the server's bundled TypeScript unless you set settings.typescript.tsdk. The extension can't look there, because Zed only lets an extension read inside the worktree.

So the server does it. When the client sends no tsdk, it walks up from each workspace folder and uses the first node_modules/typescript/lib it finds. If there's none, it uses its own TypeScript as before. I walk the folders by hand because require.resolve(…, { paths }) also searches global module folders, and could pick up a TypeScript installed on the machine.

The extension still checks the worktree root itself, so nothing changes with the 0.3.1 server on npm. The parent lookup arrives with the next server release. VS Code always sends a tsdk, so it's unaffected.

I checked tsdkFor against a temp tree:

Case Result
hoisted node_modules the hoisted lib
node_modules at the root that lib
explicit tsdk the given path
no TypeScript above the folder the server's own
non-file URI the server's own

node test/run.js passes (16/16). I haven't tried it inside Zed yet.

Based on zed-rx, so the diff only shows this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant