microsoft / microsoft/TypeScript

Signature help not select correct overload for partially completed function

Open
#33,328 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Experience Enhancement Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

From https://github.com/microsoft/vscode/issues/80570

TypeScript Version: 3.7.0-dev.20190907

Search Terms:

  • SignatureHelp
  • parameter hints

Code
For the code

declare function addEventHandler(event: "onPlayerJoin", x: number): void;
declare function addEventHandler(event: "onPlayerQuit", y: string): void;

addEventHandler('onPlayerQuit')
  1. Trigger signature help after the closing ' in the call to addEventHandler

Expected behavior:
Signature help for the second overload is returned

Actual behavior:
Signature help for both overloads is returned. We end up showing the one for onPlayerJoin first

Screen Shot 2019-09-09 at 11 24 08 AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the declare function overloads and trigger signature help after the closing quote in addEventHandler('onPlayerQuit'). No file or test is named in the issue; done means signature help selects the second overload rather than presenting both with the incorrect overload first.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.