Skip to content

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

Closed

Description

@JonnyBoy333
  • 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

Activity

  1. mjbvz commented on Jul 12, 2017

    @mjbvz
    Contributor

    This issue was moved to microsoft/TypeScript#17127

  2. added
    upstream
    on Jul 12, 2017
  3. JonnyBoy333 commented on Jul 12, 2017

    @JonnyBoy333
    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

  4. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

typescriptupstream

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions