microsoft / microsoft/TypeScript

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

Offen Anfängerfreundlich
#64,094 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

### 🔎 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne im lib-Verzeichnis des @typescript/typescript6-Kompatibilitätspakets und vergleiche den vorhandenen tsc.js-Wrapper mit dem fehlenden tsserver.js-Einstiegspunkt. Füge den entsprechenden tsserver.js-Kompatibilitätseinstiegspunkt hinzu und überprüfe, dass typescript-language-server mit dem Paket startet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
88/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.