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

Show union of supported types when completing overload #19474

Closed
mjbvz opened this issue Oct 25, 2017 · 1 comment
Closed

Show union of supported types when completing overload #19474

mjbvz opened this issue Oct 25, 2017 · 1 comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Oct 25, 2017

TypeScript Version: 2.7.0-dev.20171025

Code

interface Abc {
    abc: number
}

interface Xyz {
    xyz: number
}

declare function foo(x: Abc);
declare function foo(x: Xyz); 

foo({
    |
})

Trigger completions at |

Expected behavior:
Suggestions for both abc and xyz are returned since either version of overload could apply

Actual behavior:
Only a completion for abc is returned.

// cc @octref

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 25, 2017
@mjbvz
Copy link
Contributor Author

mjbvz commented Oct 25, 2017

Perhaps the more interesting case is:

interface Abc {
    abc: number
}

interface Xyz {
    xyz: number
}

declare function foo(x: Abc);
declare function foo(x: Xyz); 

foo({
    x|
})

In this case, no suggestions are shown because we map the argument type to Abc

@mhegazy mhegazy added Suggestion An idea for TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor labels Oct 25, 2017
@mhegazy mhegazy assigned ghost Oct 25, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Oct 25, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.7, TypeScript 2.8 Jan 9, 2018
@mhegazy mhegazy modified the milestones: TypeScript 2.8, TypeScript 2.9 Mar 9, 2018
@ghost ghost modified the milestones: TypeScript 2.9, TypeScript 3.0 May 7, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jul 2, 2018
@ghost ghost closed this as completed in #25100 Jul 11, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants