-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Provide auto-complete candidates for TypeScript string literal type when double quote is typed #25034
Comments
We do also provide intellisense once you start typing a letter. To enable this, make sure to turn on "editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
} As for actually showing the suggestions when you first type @jrieken Any thoughts on context-aware completion triggering besides just listening to keypresses? #21543 tracks a very similar problem |
I don't think context aware triggered can be done in the main side with information from the ext host side. The rule is that IntelliSense gets triggered often and in ways the extension cannot control and therefore the extension is free to return undefined/null when it cannot completion with anything meaningful. Exposing more information to the provider, like the trigger character (which is already in the document anyways), is tracked here: #752 |
Part of the problem might be how type information is exposed here: interface Meta {
color: 'Red' | 'Green' | 'Blue';
}
const meta: Meta = { color: 'Red' }; // property typed as string
type Color = 'Red' | 'Green' | 'Blue';
interface Meta2 {
color: Color;
}
const meta2: Meta = { color: 'Red' }; // property typed as Color From my understanding, both of these should be typed as |
Depends on microsoft/TypeScript#21012 |
@zackschuster Looks like that issue may have been fixed in the last year -- in both of those cases |
can confirm, my test case is working as expected. thanks for the heads-up! |
Steps to Reproduce:
When I type the double quote, the auto-complete popup should be showed. It should work like when I type the dot after an object name, the auto-complete popup is showed without Ctrl+Space.
The text was updated successfully, but these errors were encountered: