TypeScript 7 VS Code extension: a workspace "typescript" 7.x package is not detected, only "@typescript/native-preview", which is no longer published
维护者通常 1 天内回复
@jakebailey 已经在做这个了。
开始于 2026年10月6日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vscode
调研方向
从 packages/vscode-typescript/src/session.ts 开始,尤其检查 findWorkspaceNativePreviewPackages,并检查 promptUseWorkspaceVersion 和 promptSelectVersion 如何使用其结果。将现有的 @typescript/native-preview 检测与 typescript 包和 pathHasTsserverJs 进行比较。当检测到 TypeScript 7+ 工作区包,工作区提示和版本选择器提供该包,并且扩展选择该编译器时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The TypeScript 7 extension finds a workspace's own TypeScript 7 only in node_modules/@typescript/native-preview. That package was last published on 2026-07-07 (7.0.0-dev.20260707.2). TypeScript 7 now ships as typescript: [email protected] came out the next day, and the 7.1 nightlies ship as typescript@next (7.1.0-dev.20260930.4 today). So a project that installs TypeScript 7 the current way runs the extension's bundled compiler instead of its own. Nothing tells the user, and the only fix is to write a tsdk setting by hand.
Versions: TypeScript 7 extension 1.0.1, VS Code 1.140.0, macOS.
Repro
- In an empty folder, run
npm install -D typescript@nextand addmain.tswithexport const n: number = 1;. - Open the folder in VS Code with the TypeScript 7 extension installed, and open
main.ts. No setting is needed: on its first start, the extension turns TypeScript 7 on by itself (it writes"js/ts.experimental.useTsgo": trueinto the user settings). If TypeScript 7 was turned off later, run TypeScript: Enable TypeScript 7 Language Server.
Expected: the extension offers the workspace's TypeScript, as it does for @typescript/native-preview: the "This workspace has TypeScript 7 installed" prompt, and Use Workspace Version in TypeScript: Select TypeScript Version.
Actual: no prompt, and the server runs the extension's own compiler (7.0.2), not node_modules/typescript (7.1):
…/extensions/typescriptteam.native-preview-1.0.1-darwin-x64/lib/tsc --lsp --stdio
With "js/ts.tsdk.path": "node_modules/typescript", the same project runs the workspace compiler. So only the detection is missing: resolveTsdkPathToExe already accepts a typescript package (bin tsc).
Where
In packages/vscode-typescript/src/session.ts (main at 43521c80), findWorkspaceNativePreviewPackages checks only node_modules/@typescript/native-preview. Both promptUseWorkspaceVersion and the version picker (promptSelectVersion) use it.
Suggestion
Also detect node_modules/typescript when it is TypeScript 7 or newer. pathHasTsserverJs already tells a TypeScript 5 or 6 package apart from a TypeScript 7 one.
Why it matters
- The editor and the project's
tsc(CLI, CI) then run the same compiler. - Features that need a 7.1 nightly, such as content mappers with
--runExternalCode, now need either the TypeScript 7 Nightly extension or a hand-writtentsdksetting. The Nightly extension applies to every workspace and changes daily. Thetsdksetting is easy to miss, because the extension never mentions it.
- 主要语言
- Go
- 星标
- 111k
- 派生
- 15.5k
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 151
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TypeScript 的其他 Issue
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindings可能已有人在做 @dmety 于 2 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript#64661 ·
维护者通常 1 天内回复
-
Non-enum CLI options with multiple values separated by comma and space aren't whitespace trimmed可能已有人在做 @RyanCavanaugh 于 3 天前认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/TypeScript#64618 · 已指派 1 人 ·
维护者通常 1 天内回复
-
`EFNoLeadingComments` suppresses synthesized leading comments in tsgo; Strada only suppresses source comments可能已有人在做 @weswigham 于 10 天前认领。 未关闭Needs Investigation
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/TypeScript#64453 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
enhance: Add tests for premature caching of contextual parameter types可能已有人在做 @luchenxu73 于 24 天前认领。 未关闭Possible Improvement
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/TypeScript#64278 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
dom.generated.d.ts is missing from this repo while still referenced in the docs可能重新可做 @seanxuu 于 37 天前认领,目前没有进行中的 PR。 未关闭Docs
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/TypeScript#64118 · 1 条评论 ·
维护者通常 1 天内回复
查看 microsoft/TypeScript 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
open-telemetry/opentelemetry-go-compile-instrumentation#1467 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
modelcontextprotocol/go-sdk#1367 · 1 条评论 ·
维护者通常 1 天内回复
-
Python 3.15 support可能已有人在做 @amnesiaof 今天认领。 未关闭L: python L: python:uv
难度 2/5 1-3 小时 新手友好度 72/100
dependabot/dependabot-core#16524 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
duplication
难度 2/5 1-3 小时 新手友好度 78/100
openvibely/openvibely#1443 ·
维护者通常 2 天内回复