Skip to content

Return completions for properties with string keys #19433

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#36429

Code

const sounds = {
    'cat': 'meow',
    'd o g': 'woof', 
    '🐮': 'moo'
};

sounds.

Trigger completions at the end of sounds

Expected behavior:
Completion entries for all three member properties are returned. Selecting each triggers the following insertions:

sounds.cat
sounds['d o g']
sounds['🐮']

Actual behavior:
Only completion entries for valid JS identifier names are returned (cat in this instance).

The object in this case already has the correct types, we just don't return completions for them

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions