microsoft / microsoft/TypeScript

React props in typescript are displayed in alphabetical order instead of showing component props at the top when running "trigger suggest"

Offen
#52,080 9 Kommentare 50 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Domain: LS: Completion Lists Suggestion
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.74.2
  • OS Version: macOS 12.6

Steps to Reproduce:

  1. git clone reproduction repo at https://github.com/MichaelHindley/vscode-react-props-alphabetical
  2. start vscode with --disable-extensions flag
  3. run npm i to install dependencies
  4. go to Line 25 in App.tsx, place curser inside the Menu component opening tag
  5. run the "Trigger suggest" command
  6. Observe the props being sorted in alphabetical order instead of showing the components own props at the top
    image

What should happen instead is that the component scoped variables from "MenuProps" should be at the top, rather than being alphabetically sorted. The alphabetical sorting is a very poor developer experience. When triggering suggestions in a react component, the most common scenario by far is to see which props the component type has, which vscode is aware of.

image

Notice the equivalent of "trigger suggest" in Intellij, showing the components props above all the default html props;
image

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

Beginne damit, das verlinkte Reproduktions-Repository zu klonen, seine Abhängigkeiten mit npm i zu installieren und das Problem in Zeile 25 von App.tsx bei deaktivierten Erweiterungen zu reproduzieren. Verwende den Trigger suggest-Befehl am öffnenden Menu-Tag und überprüfe, dass MenuProps-Einträge vor den standardmäßigen HTML-Props erscheinen und nicht in alphabetischer Reihenfolge.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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