microsoft / microsoft/TypeScript
typescript-language-server does not work with @typescript/typescript6
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 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