Skip to content

Autocompletion for string literals can contain duplicates #15622

Description

@hediet

TypeScript version: 2.3 (Playground)

Code

function foo(x: "bla"): void;
function foo(x: "bla"): void;
function foo(x: string) {}
foo("|");

Expected behavior:
At position |, autocomplete should suggest bla once.

Actual behavior:
Autocompletion suggests bla twice:
image

Relevance
In the example above, duplication might not be a big deal. But when having multiple overloadings (maybe some with this restrictions to select a return type) or many items to complete, autocomplete gets messy:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions