microsoft / microsoft/TypeScript

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

オープン 初心者向け
#64,094 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

@typescript/typescript6 互換パッケージの lib ディレクトリから始め、既存の tsc.js ラッパーと不足している tsserver.js エントリーポイントを比較します。対応する tsserver.js 互換エントリーポイントを追加し、typescript-language-server がそのパッケージで起動することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
88/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。