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

[Feature Request] Improve suggestion for String Literal Types + string-fallback #31562

Closed
Shinigami92 opened this issue May 23, 2019 · 3 comments
Labels
Design Limitation Constraints of the existing architecture prevent this from being fixed

Comments

@Shinigami92
Copy link

When we define a type like this, we get full autosuggestion support:

Unbenannt2

But if we define a type with a fallback to string, we get nothing intelligent:

Unbenannt

@mjbvz mjbvz transferred this issue from microsoft/vscode May 23, 2019
@mjbvz mjbvz removed their assignment May 23, 2019
@RyanCavanaugh RyanCavanaugh added the Design Limitation Constraints of the existing architecture prevent this from being fixed label May 23, 2019
@RyanCavanaugh
Copy link
Member

From the type system's perspective, "red" | "green" | "blue" | string is a fancy way of writing string. The literals are lost. We don't have any mechanism for "A type plus some associated suggestions" nor plans to add one.

@Shinigami92
Copy link
Author

Shinigami92 commented May 23, 2019

But can we make this happen in the future?
It's only a Feature Request and maybe someone in the open source world can bring us this Feature.
It wont break anything but improve VS Code.

Edit: Or is this part of the language service?

@Shinigami92
Copy link
Author

Duplicate of #29729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Limitation Constraints of the existing architecture prevent this from being fixed
Projects
None yet
Development

No branches or pull requests

3 participants