Signature help shows no JSDoc for a `const` with a function type annotation

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

Maintainer thường phản hồi trong vòng 1 ngày

@MadalinWolf đang làm issue này rồi.

Từ ngày 24/10/2026.

  • #64949 của @MadalinWolf — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Start with the TypeScript language service code that provides signature help, then trace how it gets JSDoc for a function-typed const declaration. Compare the reported behavior for the declaration without an initializer, the declaration with an initializer, and an arrow function. Reproduce the case in the linked playground and add or update a regression test; done means signature help shows both the function and parameter documentation.

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

Mô tả

Bug Domain: LS: Signature Help
🔎 Search Terms

signature, parameter hints, jsdoc, const, type annotation, function type, @param

🕗 Version & Regression Information
  • This changed between versions 6.0.3 and 7.0.2 (also in 7.1.0-dev.20261023.1)
⏯ Playground Link

https://www.typescriptlang.org/play/?#code/PQKhCgAIUhBATeBnSB7AdgU0gF1ZAQ0nQFcBbAI0wCcA6KGAAQAcDqCzIA3AgGxOwAVABbZSlGrnwFEaLFPrRg4eJgDGvNtjUYkOQogDyWAFyQAFD36Yz4qtQCUkALwA+YuXsBucOBnxjTCA

💻 Code
/**
 * Adds one to a number.
 * @param value The number to add one to.
 */
declare const addOne: (value: number) => number;

addOne(1);
//     ^ trigger signature help here
🙁 Actual behavior

Signature help shows addOne(value: number): number with no description and no documentation for value. Hover on addOne does show the JSDoc.

(Type ( in the playground to ensure JSDoc is shown for the parameter in TS 6)

🙂 Expected behavior

Signature help shows "Adds one to a number." and "The number to add one to." for value, like 6.0.3 does.

Additional information about the issue

The same happens with an initializer, like const addOne: (value: number) => number = otherFunction.

(const addOne = (value: number) => value + 1 works: the docs come from the arrow function)

Ngôn ngữ chính
Go
Star
112k
Fork
15.4k
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
136

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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.

Issue khác của microsoft/TypeScript

Tất cả issue của microsoft/TypeScript

Issue tương tự

Thêm issue về Go

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.