Title: Literal String Union Autocomplete · Issue #29729 · microsoft/TypeScript · GitHub
Open Graph Title: Literal String Union Autocomplete · Issue #29729 · microsoft/TypeScript
X Title: Literal String Union Autocomplete · Issue #29729 · microsoft/TypeScript
Description: Autocomplete works for literal string unions, but adding a union of string negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be reconsidered. My use case is to have a un...
Open Graph Description: Autocomplete works for literal string unions, but adding a union of string negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be r...
X Description: Autocomplete works for literal string unions, but adding a union of string negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be r...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/29729
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Literal String Union Autocomplete","articleBody":"Autocomplete works for literal string unions, but adding a union of `string` negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be reconsidered. \r\n\r\nMy use case is to have a union of string literals for several colors, but also allow hex codes without having to add 16.7 million string literals.\r\n\r\n**TypeScript Version:** 3.4.0-dev.20190202\r\n\r\n**Search Terms:** Literal string union autocomplete\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface Options {\r\n borderColor: 'black' | 'red' | 'green' | 'yellow' | 'blue' | string\r\n};\r\n\r\nconst opts: Options = {borderColor: 'red'};\r\n```\r\n\r\n**Expected behavior:**\r\n\r\n\r\n\r\n**Actual behavior:**\r\n\r\n\r\n\r\n**Playground Link:** https://stackblitz.com/edit/typescript-bwyyab\r\n\r\n**Related Issues:** #12687 #13614\r\n","author":{"url":"https://github.com/MrTarantula","@type":"Person","name":"MrTarantula"},"datePublished":"2019-02-04T17:44:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":70},"url":"https://github.com/29729/TypeScript/issues/29729"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7fd116a8-5d26-490f-e124-1d131b35e93c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88F6:2F6413:8049EB2:AC3199C:6A5E2E45 |
| html-safe-nonce | a6afb0612e890e327be2eb504e4fb83681916dd20ff23da539868657be2a4e24 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEY2OjJGNjQxMzo4MDQ5RUIyOkFDMzE5OUM6NkE1RTJFNDUiLCJ2aXNpdG9yX2lkIjoiMzQ5MzE3ODQwMDYyNTc5ODcyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 37d10fcf4ca5fff5b5db3fc2560548facfa5bccb39e54ddde8298dcf928326ca |
| hovercard-subject-tag | issue:406443408 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Microsoft/TypeScript/29729/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64efa353f621351dda466cdce5269459840afeeb240305399c15fcf50945c9d8/microsoft/TypeScript/issues/29729 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64efa353f621351dda466cdce5269459840afeeb240305399c15fcf50945c9d8/microsoft/TypeScript/issues/29729 |
| og:image:alt | Autocomplete works for literal string unions, but adding a union of string negates autocomplete entirely. This has been brought up before but I believe there is enough value in this feature to be r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MrTarantula |
| hostname | github.com |
| expected-hostname | github.com |
| None | 621588b5bccbeb4b6fab0bb72b5de86200d5e6df07dbdabbdb667c8649f6e38d |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 14f1e1fce2dc2d662cbf7ef602c59756c2283f9e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width