microsoft / microsoft/TypeScript

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

Đang mở
#52,080 9 bình luận 50 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Awaiting More Feedback Domain: LS: Completion Lists Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách clone repository tái hiện được liên kết, cài đặt các dependency của repository bằng npm i và tái hiện vấn đề ở dòng 25 của App.tsx khi đã tắt các extension. Sử dụng lệnh Trigger suggest trên thẻ mở của Menu và xác minh rằng các mục MenuProps xuất hiện trước các HTML props mặc định thay vì theo thứ tự alphabet.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
developer-experience
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.