String literal union types are validated, but values are not suggested by IDEs #12891
Labels
Domain: Completion Lists
The issue relates to showing completion lists in an editor
Fixed
A PR has been merged for this issue
Suggestion
An idea for TypeScript
In the 3 IDEs I've tried (VS2015u3, VS2017RC, and VSCode 1.7.2), string literal union type values are detected and underlined in real time if invalid, and the error message lists values that would be valid, but the IDE won't help you type those values or suggest anything.
TypeScript Version: 2.1.4
Code
The value is detected as an error in all IDEs, and the tooltip in all IDEs indicates what values (or the first several until trailing off, if there are many) are valid:
Expected behavior:
Auto-completion suggestions should include, and be limited to, the same two possible string values that are indicated in the error.
Actual behavior:
VS2015u3 and VS2017RC provide no suggestions. VSCode technically does provide the suggestion given the sample above, but only because it appears as a literal in the same file and VSCode always does that; if you move the reducer function to a separate file, VSCode will not have a suggestion either.
The text was updated successfully, but these errors were encountered: