Title: Properties in object literal key completion list aren't filtered when a prior argument supplies a mapped type key · Issue #35702 · microsoft/TypeScript · GitHub
Open Graph Title: Properties in object literal key completion list aren't filtered when a prior argument supplies a mapped type key · Issue #35702 · microsoft/TypeScript
X Title: Properties in object literal key completion list aren't filtered when a prior argument supplies a mapped type key · Issue #35702 · microsoft/TypeScript
Description: VSCode Version: 1.41.0 OS Version: macOS 10.14.6 Steps to Reproduce: >> Playground Link interface CustomElements { 'component-one': { foo?: string; }, 'component-two': { bar?: string; } } interface Options
Open Graph Description: VSCode Version: 1.41.0 OS Version: macOS 10.14.6 Steps to Reproduce: >> Playground Link interface CustomElements { 'component-one': { foo?: string; }, 'component-two': { bar?: string; } } interface...
X Description: VSCode Version: 1.41.0 OS Version: macOS 10.14.6 Steps to Reproduce: >> Playground Link interface CustomElements { 'component-one': { foo?: string; }, 'component-two': { bar?:...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/35702
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Properties in object literal key completion list aren't filtered when a prior argument supplies a mapped type key","articleBody":"- VSCode Version: 1.41.0\r\n- OS Version: macOS 10.14.6\r\n\r\nSteps to Reproduce:\r\n\r\n\\>\\> [Playground Link](https://www.typescriptlang.org/play/index.html?ssl=23&ssc=1&pln=19&pc=1#code/JYOwLgpgTgZghgYwgAgMIFcDOYD2BbAUQBsI8JxNkBvAWAChlHkByBfABxxHLAFouIzAFzV6Tcchg4cAfhHYooAOYBuMUwC+AGnWNWHAeF5gA7jmGiGExgCM4UOcgXK1Vxhvoe69UJFiIUAHl2MGAuTAAeABVkCAAPSBAAE0oAawgATxwYNCxcQhIyCgA+S3F2KBx2TBEMbHxiUh5MAG0ogF1XL3oYdBAEUK5kBCgIOEho2ITyFOR0rJy6-MaisExigAoQODIRKK1kKsGQGuRg48io4oBKMqZRsHQoEGpkbbIDo7CT5A0u+noIzGkA2+jwnG4RgEzAOVGQFSqpzhv1+11cgPCYEOIVO52+kTBEJ4-G4zFKAF47owEdURMivF4gA)\r\n\r\n```ts\r\ninterface CustomElements {\r\n 'component-one': {\r\n foo?: string;\r\n },\r\n 'component-two': {\r\n bar?: string;\r\n }\r\n}\r\n\r\ninterface Options\u003cT extends keyof CustomElements> {\r\n props: CustomElements[T];\r\n}\r\n\r\nfunction create\u003cT extends keyof CustomElements>(name: T, options: Options\u003cT>) {\r\n return { name, options };\r\n}\r\n\r\ncreate('component-one', { props: { /* trigger intellisense here */ } });\r\n\r\nconst opts: Options\u003c'component-one'> = {\r\n props: { /* and here */ }\r\n}\r\n```\r\n\r\nThe type of `props` in the `create` call is correctly narrowed down to `CustomElements['component-one']` by the type system, however Intellisense suggests the props of all fields of `CustomElements`:\r\n\r\n\u003cimg src=\"https://user-images.githubusercontent.com/3410759/70867563-10b3a780-1f77-11ea-8440-2769d5d158ab.png\" width=\"642\">\r\n\r\nThis does not happen when creating an object of that type:\r\n\r\n\u003cimg src=\"https://user-images.githubusercontent.com/3410759/70867546-d8ac6480-1f76-11ea-931a-2e1f1dce4129.png\" width=\"479\">\r\n\r\nDoes this issue occur when all extensions are disabled?: Yes\r\n","author":{"url":"https://github.com/simonhaenisch","@type":"Person","name":"simonhaenisch"},"datePublished":"2019-12-15T19:14:47Z","url":"https://github.com/microsoft/TypeScript/issues/35702"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:e1833cdc-006d-04fa-9a80-ea1064bd6964 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9174:172B92:100DB8D:1577BDA:6B0112B1 |
| html-safe-nonce | 32e6b03e22734c673925a04fea8eef305b96900b35d22fac5ba9a7ac2472d6be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTc0OjE3MkI5MjoxMDBEQjhEOjE1NzdCREE6NkIwMTEyQjEiLCJ2aXNpdG9yX2lkIjoiMTUxOTEzOTA0NDAxNjA2NzI1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c26ed8957011026f19cfd7613c8003569c3a8f769d129292c59806023bdf7384 |
| hovercard-subject-tag | issue:538526675 |
| 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/35702/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7e79d86c0bd90e3ab60eabf0b61b0c82ea7d537b647ca3e4fd75a83c689295b2/microsoft/TypeScript/issues/35702 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7e79d86c0bd90e3ab60eabf0b61b0c82ea7d537b647ca3e4fd75a83c689295b2/microsoft/TypeScript/issues/35702 |
| og:image:alt | VSCode Version: 1.41.0 OS Version: macOS 10.14.6 Steps to Reproduce: >> Playground Link interface CustomElements { 'component-one': { foo?: string; }, 'component-two': { bar?: string; } } interface... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | simonhaenisch |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width