microsoft / microsoft/TypeScript

typescript-language-server does not work with @typescript/typescript6

Open Beginner friendly
#64,094 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
111k
Forks
14.3k
PR merge metrics
PR metrics pending

Description

### 🔎 Search Terms

lsp language server tsserver.js

### 🕗 Version & Regression Information

- This is an issue with the new @typescript/typescript6 package

### ⏯ Playground Link

_No response_

### 💻 Code

_No response_

### 🙁 Actual behavior

I have installed both TypeScript 6 and 7 side to side following [the blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0).
Unfortunately, `typescript-language-server` (which is a LSP wrapper around `tsserver` from TypeScript 6) does not work in this setup. It is looking for a `tsserver.js` file in `node_modules/typescript/lib`, which does not exist in `@typescript/typescript6`.

### 🙂 Expected behavior

The `@typescript/typescript6` package is for compatibility with software based on TypeScript 6, so it should include a `tsserver.js` executable. I believe the only thing needed is to add a `tsserver.js` file in the `lib` directory containing:
```js
require("@typescript/old/lib/tsserver.js");
```
(same pattern as the existing `tsc.js` file)
I tested it and `typescript-language-server` does start when adding this file.

### Additional information about the issue

I know that TypeScript 7 includes a new native LSP server, but it does not have all the features that tsserver had. In particular the lack of code actions like "Move to file" make it so that I want to be able to switch between the old and the new server until the new server reaches feature parity.

Contributor guide

Open the contributing guide

Research direction

Start in the @typescript/typescript6 compatibility package's lib directory and compare the existing tsc.js wrapper with the missing tsserver.js entry point. Add the corresponding tsserver.js compatibility entry point and verify that typescript-language-server starts with the package.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.