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

Return completions for properties with string keys #19433

Closed
mjbvz opened this issue Oct 23, 2017 · 1 comment
Closed

Return completions for properties with string keys #19433

mjbvz opened this issue Oct 23, 2017 · 1 comment
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Oct 23, 2017

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

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 23, 2017
@mjbvz
Copy link
Contributor Author

mjbvz commented Oct 23, 2017

This would likely require adding a new insertText property on CompletionEntry

interface CompletionEntry {
    name: string;

    insertText?: string

    ...
}

@mhegazy mhegazy added the Suggestion An idea for TypeScript label Oct 24, 2017
@mhegazy mhegazy assigned ghost Oct 24, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Jan 9, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jan 9, 2018
@ghost ghost closed this as completed in #20547 Jan 9, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants