microsoft / microsoft/TypeScript

VSCode unable to retrieve typing information with composite, emitDeclarationOnly and strict

Abierto
#45,665 0 comentarios 2 reacciones 1 asignado Ver en GitHub

@sandersn ya está trabajando en esto.

Desde el 1/9/2021.

Needs Investigation Rescheduled
Lenguaje dominante
Go
Estrellas
111k
Forks
14.4k
Merge medio
1 d 19 h
PR fusionados (30 d)
117

Descripción

TL;DR

Exactly the same as #43909 with addition of "strict": true re-exposing the same issue, and also tested and reproing against TS 4.3.5 and 4.4.2. I've updated the same repro to cover this case.

Bug Report

🔎 Search Terms

composite project references emit declaration emitdeclarationonly vscode strict

🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about: declarationEmitOnly and composite/project references

I've tried:

  • 4.3.5
  • 4.4.2
⏯ Playground Link

I don't think it's possible to set up multiple projects using project references in Playground. If I'm mistaken, please let me know. For now I've created the smallest repro I can below.

💻 Code

As this uses project references I set up a basic monorepo with no external deps other than typescript.

To repro (also in README.md):

  1. clone https://github.com/JasonGore/ts-composite-declaration.git
  2. run yarn
  3. cd packages/emit-standard
  4. yarn tsc
  5. cd ../packages/emit-composite
  6. yarn tsc (although I don't think this should technically be needed for projrefs)

Open VSCode from repo root and open packages/consumer/src/index.ts and note comments.

🙁 Actual behavior

This is an emitDeclarationOnly example emitting type information for packages that have .js files. The only difference between emit-standard and emit-composite is that one has composite set to true and is a reference of consumer package.

In VSCode, emit-composite seems unable to retrieve typing information, whether or not emit-composite/lib output exists:

image

However, if you run yarn tsc in packages/consumer, typing information DOES seem to be available. I'm not sure if this is a TS or VSCode bug. For each TS version I tried above I ensured that VSCode was using "workspace version" and all exhibit this behavior.

🙂 Expected behavior

Typing information should be available in VSCode for both cases.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.