microsoft / microsoft/TypeScript
React props in typescript are displayed in alphabetical order instead of showing component props at the top when running "trigger suggest"
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.74.2
- OS Version: macOS 12.6
Steps to Reproduce:
- git clone reproduction repo at https://github.com/MichaelHindley/vscode-react-props-alphabetical
- start vscode with --disable-extensions flag
- run
npm ito install dependencies - go to Line 25 in App.tsx, place curser inside the Menu component opening tag
- run the "Trigger suggest" command
- Observe the props being sorted in alphabetical order instead of showing the components own props at the top

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.
Notice the equivalent of "trigger suggest" in Intellij, showing the components props above all the default html props;

コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、リンクされた再現用リポジトリをクローンし、npm i で依存関係をインストールして、拡張機能を無効にした状態で App.tsx の25行目の問題を再現します。Menu の開始タグで Trigger suggest コマンドを使用し、MenuProps のエントリがデフォルトの HTML props より前に表示され、アルファベット順になっていないことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- developer-experience
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100