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 Autocompletion Not Working For Function Overloads #57509

Closed
MartinLoeper opened this issue Aug 29, 2018 · 1 comment
Closed

Typescript Autocompletion Not Working For Function Overloads #57509

MartinLoeper opened this issue Aug 29, 2018 · 1 comment
Assignees
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@MartinLoeper
Copy link

  • VSCode Version: 1.25.1 1dfc5e5 x64
  • OS Version: Linux version 4.15.0-32-generic Ubuntu

Steps to Reproduce:
I provided a small example of the issue (see screenshot below).

  1. Create a function with two overloads
  2. Try to invoke this function
  3. Once you typed in the first parameter, the IDE recognizes that it matches the first overload's signature.
    However, the auto-completion suggest the literals for both overloads.

I expect the auto-completion to show "BW" and "BY" only!

_005

Does this issue occur when all extensions are disabled?: Yes

The code:

export class MomentHolidayFactory {
    public a(input: Germany, second: GermanState): string;
    public a(input: Austria, second: AustrianState): string;

    public a(input: Country, second: State): string {
        return "test";
    }

    public holidays() {
        this.a("de", ""
    }
}

type Country = Germany & Austria;
type Germany = "de" | "De" | "DE" | "germany";
type Austria = "Au" | "au" | "AU" | "austria";

type State = GermanState & AustrianState;
type GermanState = "BW" | "BY";
type AustrianState = "Stmk" | "Vbg";
@vscodebot vscodebot bot added the typescript Typescript support issues label Aug 29, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Sep 5, 2018

This issue was moved to microsoft/TypeScript#26892

@mjbvz mjbvz closed this as completed Sep 5, 2018
@mjbvz mjbvz added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Sep 5, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 20, 2018
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