Skip to content

fix(language-server): Don't depend on TypeScript being available#16627

Merged
Princesseuh merged 2 commits intomainfrom
fix/language-server-ts
May 6, 2026
Merged

fix(language-server): Don't depend on TypeScript being available#16627
Princesseuh merged 2 commits intomainfrom
fix/language-server-ts

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh commented May 6, 2026

Changes

Fixes #16612

Testing

Should pass! We unfortunately cannot test this in the monorepo because TypeScript is of course always available

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

🦋 Changeset detected

Latest commit: 5155dd1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Princesseuh Princesseuh marked this pull request as ready for review May 6, 2026 11:50
Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the actual call site that passes ts to these methods? Is it conditionally loading TypeScript based on availability?

We unfortunately cannot test this in the monorepo because TypeScript is of course always available

rm('node_modules/typescript', { recursive: true }) in the test suite you cowards!

Just kidding, I’m sure it’s fine.

@Princesseuh
Copy link
Copy Markdown
Member Author

What’s the actual call site that passes ts to these methods? Is it conditionally loading TypeScript based on availability?

The language-server init point takes in a path to a tsdk, it does that because for instance, a project might not have TypeScript installed at all, but VS Code provides a global typescript outside of the project (hence the option to "Use workspace TypeScript" in the editor).

This also happens for users on Neovim and stuff, where their recommended workflow is to install TypeScript globally (literally npm -g typescript) and then in their Neovim config, point to the TypeScript they installed.

As such, you can never literally import from typescript, it always has to come from said init point

@Princesseuh Princesseuh merged commit 5778cb7 into main May 6, 2026
25 checks passed
@Princesseuh Princesseuh deleted the fix/language-server-ts branch May 6, 2026 13:28
@astrobot-houston astrobot-houston mentioned this pull request May 6, 2026
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.

BUG: language-server crashes on attach

2 participants