Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript auto-complete only shows JSDoc for first function overload #80292

Closed
ericyhwang opened this issue Sep 4, 2019 · 2 comments
Closed
Assignees
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@ericyhwang
Copy link

Issue Type: Bug

Steps:

  1. Paste this into a TypeScript file:
/** 5-arg overload */
function add(a: number, b: number, c: number, d: number, e: number): number;
function add(a: number, b: number, c: number, d: number): number;
/** 3-arg overload */
function add(a: number, b: number, c: number): number;
function add(a: number, b: number): number;
function add(...numbers: number[]) {
  let total = 0;
  for (const num of numbers) {
    total += num;
  }
  return total;
}
add(1, 2, 3, 4);
  1. Start typing add( at the bottom to bring up auto-complete, then hit the Down arrow to go to the second overload.

Expected: The auto-complete for the second overload shows docs from the doc-comment, same as it did the first overload.

Actual: The auto-complete for the second overload does not show docs.

Additional note: If you hover over the fully completed add(1, 2, 3, 4);, which is an overload without a doc-comment, it mostly works, showing a merged version "5-arg overload 3-arg overload". This behavior is totally OK for functions where there's one single doc-block above all overloads, it's just a bit odd in the case where you document 2+ overloads but not all of them.

VS Code version: Code - Insiders 1.38.0-insider (3db7e09, 2019-09-03T23:11:54.533Z)
OS version: Darwin x64 18.7.0

Extensions: none

@ericyhwang
Copy link
Author

I did a bit more searching of issues, and I noticed a lot of VS Code issues were re-filed upstream on TypeScript.

So I did some searching there and found two relevant issues:

For the second issue, it looks like there's a PR open: microsoft/TypeScript#30253

I'm not sure if the vscode project's policy is to leave issues open until TypeScript fixes are merged, so I'll leave it up to a maintainer to decide whether to close this one or not.

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 9, 2019

Closing as upstream

@mjbvz mjbvz closed this as completed Sep 9, 2019
@mjbvz mjbvz added typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels Sep 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants