microsoft / microsoft/TypeScript
typescript-language-server does not work with @typescript/typescript6
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez dans le répertoire lib du paquet de compatibilité @typescript/typescript6 et comparez le wrapper tsc.js existant avec le point d’entrée tsserver.js manquant. Ajoutez le point d’entrée de compatibilité tsserver.js correspondant et vérifiez que typescript-language-server démarre avec le paquet.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 1/5
- Temps estimé
- Moins d'une heure
- Activité
- Active
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 88/100