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

tsserver: completion for union type of literal and string is broken from 2.1 #12687

Closed
wonderful-panda opened this issue Dec 6, 2016 · 2 comments
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor

Comments

@wonderful-panda
Copy link
Contributor

TypeScript Version: 2.1.1

Code

type Test = "foo" | "bar" | string;
const x: Test = "/* CURSOR POSITION */";

Expected behavior:
tsserver returns "foo" and "bar" as completion candidates.

Actual behavior:
2.0.10 behaves as expected.
2.1.1 returns no candidates.

@mhegazy mhegazy added the Bug A bug in TypeScript label Dec 6, 2016
@mhegazy mhegazy added this to the TypeScript 2.2 milestone Dec 6, 2016
@mhegazy mhegazy assigned ghost Dec 6, 2016
@ghost
Copy link

ghost commented Jan 9, 2017

The type "foo" | "bar" | string is equivalent to the string type and now gets simplified early on. So all we see when querying the type checker for the type of x is string. So, this can't be fixed.

@oldrich-s
Copy link

@andy-ms combobox is equivalent to input text field? Why do people use comboboxes then? This is what happens when math purity gets precedence to usability...

@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
@weswigham weswigham added the Domain: Completion Lists The issue relates to showing completion lists in an editor label Nov 30, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor
Projects
None yet
Development

No branches or pull requests

4 participants