Skip to content

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

Closed
@mjbvz

Description

@mjbvz

From @JonnyBoy333 on July 12, 2017 15:31

  • 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

Copied from original issue: microsoft/vscode#30526

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDesign LimitationConstraints of the existing architecture prevent this from being fixedVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions