microsoft / microsoft/TypeScript

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

オープン
#52,080 コメント 9 件 リアクション 50 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Awaiting More Feedback Domain: LS: Completion Lists Suggestion
主要言語
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:

  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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、リンクされた再現用リポジトリをクローンし、npm i で依存関係をインストールして、拡張機能を無効にした状態で App.tsx の25行目の問題を再現します。Menu の開始タグで Trigger suggest コマンドを使用し、MenuProps のエントリがデフォルトの HTML props より前に表示され、アルファベット順になっていないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
developer-experience
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。