Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

TypeScript 7 VS Code extension: a workspace "typescript" 7.x package is not detected, only "@typescript/native-preview", which is no longer published

Aberta Para iniciantes
#64,565 0 comentários 1 reação 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@jakebailey já está trabalhando nisso.

Desde 6/10/2026.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
84/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
typescript, vscode

Direção de pesquisa

Comece em packages/vscode-typescript/src/session.ts, especialmente em findWorkspaceNativePreviewPackages, e inspecione como promptUseWorkspaceVersion e promptSelectVersion consomem os resultados. Compare a detecção existente de @typescript/native-preview com o pacote typescript e pathHasTsserverJs. Está concluído quando um pacote do workspace do TypeScript 7+ é detectado, o prompt do workspace e o seletor de versão o oferecem e a extensão seleciona esse compilador.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs Investigation

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
  1. In an empty folder, run npm install -D typescript@next and add main.ts with export const n: number = 1;.
  2. 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": true into 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-written tsdk setting. The Nightly extension applies to every workspace and changes daily. The tsdk setting is easy to miss, because the extension never mentions it.
Linguagem predominante
Go
Estrelas
111k
Forks
15.5k
Merge médio
1d 21h
PRs com merge (30d)
150

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/TypeScript

Todas as issues de microsoft/TypeScript

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.