microsoft / microsoft/TypeScript

VSCode version 1.58.2 Not able to add new imports in Typescript rush monorepos

Offen
#45,300 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: LS: Auto-import Needs Investigation
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.58.2
  • OS Version: macOS Big Sur 11.4
  • Extension ids: [coenraads.bracket-pair-colorizer, wmaurer.change-case, streetsidesoftware.code-spell-checker, dbaeumer.vscode-eslint, file-icons.file-icons, eamodio.gitlens, esbenp.prettier-vscode, netcorext.uuid-generator, vscodevim.vim]

Steps to Reproduce:

  1. Create an interface Foo in a new location
  2. Create a class that depends on the Foo interface and try to auto import the definition through the VSCode auto import feature (highlight the interface and use command + . to open the suggested actions)
  3. The only option it will give the user if nothing has been imported from this location before is to extract to a type alias
  4. If something had been imported from the same location however, it can add the import to the existing list of imports

What should happen:

VSCode should suggest creating a new import statement for that interface at the top of the class file

What actually happens:
using command + . yields only the option to Extract to type alias.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem in VS Code 1.58.2 mit einem TypeScript Rush monorepo, bei dem die Erweiterungen deaktiviert sind, und vergleiche einen neuen Importort mit einem bereits importierten. Verfolge das Verhalten von TypeScript auto-import und suggested-actions; als erledigt gilt die Aufgabe, wenn Command+‍. ein Import-Statement für das Interface anbietet und gleichzeitig bestehende Importvorschläge beibehält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, vscode
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.