microsoft / microsoft/TypeScript

Inlay hints should support spread arguments for tuple types

Đang mở
#45,868 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

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

Needs Proposal 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ả

Issue Type: Bug

Inlay hints don't support rest params spread parameters.
For example, I'm using this method which has the following signature:

controls.setPosition(x: number, y: number, z: number, enableTransition: boolean);

And I want to pass in a Vector3Tuple as the position, say [0,0,0]:

type Vector3Tuple = [number, number, number];

const position: Vector3Tuple = [0,0,0];

controls.setPosition(...position, false);

This is what I see for the inlay hints:

inlay rest

In other words, ...position is showing as a single argument when it should be three.

If I expand the arguments, it does correctly show the hints:

inlay explicit

I'm not sure what the inlay hints should show for ...position, however, the final parameter of false should correctly show enableTransition.

VS Code version: Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff, 2021-09-01T10:41:52.311Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

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

Issue không nêu tên tệp hoặc kiểm thử nào. Hãy tái hiện ví dụ spread Vector3Tuple được cung cấp với inlay hints của TypeScript được bật, sau đó so sánh với ví dụ sử dụng các đối số tường minh; được xem là hoàn tất khi đối số false cuối cùng được gắn nhãn enableTransition và các đối số spread nhận được các hint phù hợp.

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

Đánh giá

Công nghệ
typescript, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
38/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.