microsoft / microsoft/TypeScript
Display inlay hints with defining variables by destructuring assignment
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.4k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 117
Description
🔍 Search Terms
inlay hints
vscode
destructuring assignment
✅ 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 feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
In the following example, inlay hints are not shown in VSCode.
const [value, setValue] = useState("");
I hope inlay hints will look like this.
const [value /*: string */, setValue /*: React.Dispatch<React.SetStateAction<string>> */] = useState("");
📃 Motivating Example
It allows you to know the type without hovering, improving development efficiency.
💻 Use Cases
- What do you want to use this for?
I want to display inlay hints with defining variables by destructuring assignment in VSCode. - What shortcomings exist with current approaches?
I can't know the inference types without hovering. - What workarounds are you using in the meantime?
I hover and look at the types.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par l’implémentation TypeScript des indications intégrées et son intégration à VSCode, en utilisant comme cas de reproduction l’exemple d’affectation par déstructuration de l’issue. Déterminez comment les types inférés de chaque variable déstructurée sont représentés, puis vérifiez que des indications apparaissent à la fois pour value et pour setValue sans modifier le JavaScript généré.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript, vscode
- Domaine
- developer-experience, tooling
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100