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

Autocomplete/Intellisense Does Not Show All Options For Object Value #30526

Closed
JonnyBoy333 opened this issue Jul 12, 2017 · 2 comments
Closed
Assignees
Labels
typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@JonnyBoy333
Copy link

  • VSCode Version: 1.14.0
  • OS Version: macOS 10.12.5

Autocomplete/intellisense is not showing all the options for an object that goes into a function parameter even though it is defined in a typescript interface.

Example:

interface Fruit {
    /** Returns a fruit color. */
    getFruitColor(options: { fruit: 'apple' | 'orange' }): string;
    getFruitColor(options: { fruit: 'banana' }): boolean;
}

function testFunction (fruit: Fruit) {
    let color = fruit.getFruitColor({ fruit: '' }); // <-- Autocomplete only shows apple and orange as options and not banana
}

screen shot 2017-07-12 at 10 27 36 am

It appears that only the first method's options object is getting indexed by VS autocomplete but not the second one.

Reproduces without extensions: Yes

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 12, 2017

This issue was moved to microsoft/TypeScript#17127

@mjbvz mjbvz closed this as completed Jul 12, 2017
@mjbvz mjbvz added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 12, 2017
@JonnyBoy333
Copy link
Author

Thanks the quick action. I would like to note, however, that other IDE's seem to be able to handle this situation, which is why I put it under the vscode github instead of typescript.

Example:
WebStorm
screen shot 2017-07-12 at 12 14 13 pm

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
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

3 participants