microsoft / microsoft/TypeScript

JSDoc @param does not work for function variables

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

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

Từ ngày 2/3/2020.

Needs Investigation
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

TypeScript Version: 3.5.1, 3.7.5

Search Terms: jsdoc, param, variable, function

Code

function makeFoo() {
    return (x : number) => {}
}

/**
 * @param x - Comment
 */
const foo = makeFoo();
foo(/* No comment in hover */);

/**
 * @param x - Comment
 */
function foo2(x: number) {
    
}
foo2(/* Comment in hover */)

Expected behavior:
image

Actual behavior:
image

Playground Link: Playground

Related Issues: Couldn't find any


For my use case, I use factories to make functions a lot.

export const lPad = makeOperator3<string, bigint, string, string>(/*args*/);
export const rPad = makeOperator3<string, bigint, string, string>(/*args*/);
export const lTrim = makeOperator1<string, string>(/*args*/);
export const rTrim = makeOperator1<string, string>(/*args*/);

And I'd like to add JSDoc to these variables, because the parameter names aren't very descriptive, by themselves (left, mid, right, arg, etc.). But it seems like the JSDoc for @param does not show up in hover on VS Code and the Playground.

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.

Đánh giá

Issue này chưa được đánh giá.

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.