microsoft / microsoft/TypeScript
@import suggestions for auto-imports in VS Code
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔍 Search Terms
@import, auto-import, JSDoc
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Taken from a chat with @andrewbranch:
When working a JS codebase, it's common to want to import types. As of TS 5.5 we have the JSDoc @import tag which is wonderful!
However, VS Code does not offer it as an option for auto imports. Consider the following help menu:
I like the Change 'Customer' to 'import... suggestion, what I'd like even more would be a suggestion to Add /** @import {Customer} from ...
📃 Motivating Example
It doesn't improve the language. It improves the developer experience of JSDoc.
💻 Use Cases
- What do you want to use this for?
Working in VS Code more effectively. - What shortcomings exist with current approaches?
Current suggestions are more verbose. - What workarounds are you using in the meantime?
Writing imports by hand.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal menu della guida per l'auto-import esistente di VS Code e dal suggerimento “Change 'Customer'...” descritto nell'issue. Traccia il modo in cui tale suggerimento viene prodotto per i file JavaScript, quindi aggiungi un'opzione JSDoc @import corrispondente e verifica che venga visualizzata per il caso di importazione del tipo alla base dell'issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100