René's URL Explorer Experiment


Title: Display narrowed type of properties in `completionEntryDetails` · Issue #51526 · microsoft/TypeScript · GitHub

Open Graph Title: Display narrowed type of properties in `completionEntryDetails` · Issue #51526 · microsoft/TypeScript

X Title: Display narrowed type of properties in `completionEntryDetails` · Issue #51526 · microsoft/TypeScript

Description: interface Palette { red?: Color; green?: Color; blue?: Color; } type Color = string | [number, number, number]; function checkOrange(p: Palette) { if (typeof p === "object" && "orange" in p && typeof p.orange === "number") { p./**/ } } R...

Open Graph Description: interface Palette { red?: Color; green?: Color; blue?: Color; } type Color = string | [number, number, number]; function checkOrange(p: Palette) { if (typeof p === "object" && "orange" in p && type...

X Description: interface Palette { red?: Color; green?: Color; blue?: Color; } type Color = string | [number, number, number]; function checkOrange(p: Palette) { if (typeof p === "object" && &qu...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/51526

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Display narrowed type of properties in `completionEntryDetails`","articleBody":"```ts\r\ninterface Palette {\r\n    red?: Color;\r\n    green?: Color;\r\n    blue?: Color;\r\n}\r\n\r\ntype Color = string | [number, number, number];\r\n\r\nfunction checkOrange(p: Palette) {\r\n    if (typeof p === \"object\" && \"orange\" in p && typeof p.orange === \"number\") {\r\n        p./**/\r\n    }\r\n}\r\n```\r\n\r\nRequest completions at `/**/` and select the option for `orange`.\r\n\r\n\u003cdetails>\r\n\u003csummary>\u003cspan>Today, we show\r\n\r\n```\r\n(property) orange: unknown\r\n```\r\n\r\n\u003c/span>\r\n\r\n![image](https://user-images.githubusercontent.com/972891/201755666-933e990e-3c27-450a-82c7-682a36dfa346.png)\r\n\r\n\u003c/summary>\r\n\r\n```json5\r\n[\r\n    {\r\n        \"name\": \"orange\",\r\n        \"kindModifiers\": \"\",\r\n        \"kind\": \"property\",\r\n        \"displayParts\": [\r\n            {\r\n                \"text\": \"(\",\r\n                \"kind\": \"punctuation\"\r\n            },\r\n            {\r\n                \"text\": \"property\",\r\n                \"kind\": \"text\"\r\n            },\r\n            {\r\n                \"text\": \")\",\r\n                \"kind\": \"punctuation\"\r\n            },\r\n            {\r\n                \"text\": \" \",\r\n                \"kind\": \"space\"\r\n            },\r\n            {\r\n                \"text\": \"orange\",\r\n                \"kind\": \"propertyName\"\r\n            },\r\n            {\r\n                \"text\": \":\",\r\n                \"kind\": \"punctuation\"\r\n            },\r\n            {\r\n                \"text\": \" \",\r\n                \"kind\": \"space\"\r\n            },\r\n            {\r\n                \"text\": \"unknown\",\r\n                \"kind\": \"keyword\"\r\n            }\r\n        ],\r\n        \"documentation\": [],\r\n        \"tags\": []\r\n    }\r\n]\r\n```\r\n\r\n\u003c/details>\r\n\r\nThis has to do with how we decide to display properties - we simply request the type of what `p` is narrowed to, not the type of individual properties. This is actually part of another weirder distinction, where narrowing a property doesn't also narrow the containing value's type.\r\n\r\nRecently there's been some discussion around whether we could do that; however, I am a bit skeptical here. Short of that, it would be nice to show users the actual type they're using.\r\n\r\nThis could get a little bit expensive; but narrowing in general should get cheaper. In theory, #51525 could avoid much of the work, and make the overhead here very low.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2022-11-14T20:21:30Z","url":"https://github.com/microsoft/TypeScript/issues/51526"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e86122b9-bd2e-5685-d809-a7fc61e98868
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA3AE:33251C:6B1A3C:95937E:6B05C2AA
html-safe-nonce204fd1ad2d6df63c730b7f2502ae9fdcc7e545489f3b6fdf8e7165baefe02241
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0FFOjMzMjUxQzo2QjFBM0M6OTU5MzdFOjZCMDVDMkFBIiwidmlzaXRvcl9pZCI6IjUyNTMwMDEwMDYzMjkyMTc3MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca1908f6bcc8c370e701c1c94f9156ad669f678af3cf547d34a8fd0493e22cbc4
hovercard-subject-tagissue:1448694963
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/51526/issue_layout
twitter:imagehttps://opengraph.githubassets.com/92ff0021fab16c38ebfe73583571b16c423c7beb5029584ebdc70728e652c7bd/microsoft/TypeScript/issues/51526
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/92ff0021fab16c38ebfe73583571b16c423c7beb5029584ebdc70728e652c7bd/microsoft/TypeScript/issues/51526
og:image:altinterface Palette { red?: Color; green?: Color; blue?: Color; } type Color = string | [number, number, number]; function checkOrange(p: Palette) { if (typeof p === "object" && "orange" in p && type...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None708c2f10d746dbcf1dd80dc8309daa7d595df3fce8066244380fc3238618f09c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2a29e3cf4fb57e81fd311774f91f345cc4436f40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/51526#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F51526
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F51526
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/51526
Reloadhttps://github.com/microsoft/TypeScript/issues/51526
Reloadhttps://github.com/microsoft/TypeScript/issues/51526
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests323 (323)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51526
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51526
Display narrowed type of properties in completionEntryDetailshttps://github.com/microsoft/TypeScript/issues/51526#top
Domain: LS: Type Displayhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
In Discussionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Nov 14, 2022https://github.com/microsoft/TypeScript/issues/51526#issue-1448694963
https://user-images.githubusercontent.com/972891/201755666-933e990e-3c27-450a-82c7-682a36dfa346.png
#51525https://github.com/microsoft/TypeScript/issues/51525
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In Discussionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Domain: LS: Type Displayhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
on Nov 14, 2022https://github.com/microsoft/TypeScript/issues/51526#event-7807834178
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Nov 14, 2022https://github.com/microsoft/TypeScript/issues/51526#event-7807840180
https://github.com/fatcerberus
Bruce Pascoe (fatcerberus)https://github.com/fatcerberus
on Nov 14, 2022https://github.com/microsoft/TypeScript/issues/51526#issuecomment-1314369842
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Nov 15, 2022https://github.com/microsoft/TypeScript/issues/51526#issuecomment-1314570505
https://github.com/JulioC
Júlio César (JulioC)https://github.com/JulioC
on Sep 28, 2023https://github.com/microsoft/TypeScript/issues/51526#issuecomment-1740001125
https://www.typescriptlang.org/play?noUnusedLocals=true&noUnusedParameters=true&checkJs=true&allowJs=true&module=1&emitDeclarationOnly=true&stripInternal=true&ts=5.1.6#code/MYewdgzgLgBCBGArAXDA3gBwE4gwflWiwEswBzGAHxgFcwATAUwDNTH6YBfGAXnW4CGEGALABPANwAoKaEggANowB0CkGQAUCRMuy4AlNID0RmGfMXzAPTwzizGFqS6cGfeilm5ERSrWbtFwNpMxNLcLMbKU4pIAhttps://www.typescriptlang.org/play?noUnusedLocals=true&noUnusedParameters=true&checkJs=true&allowJs=true&module=1&emitDeclarationOnly=true&stripInternal=true&ts=5.1.6#code/MYewdgzgLgBCBGArAXDA3gBwE4gwflWiwEswBzGAHxgFcwATAUwDNTH6YBfGAXnW4CGEGALABPANwAoKaEggANowB0CkGQAUCRMuy4AlNID0RmGfMXzAPTwzizGFqS6cGfeilm5ERSrWbtFwNpMxNLcLMbKU4pIA
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/51526
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51526
Domain: LS: Type Displayhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20LS%3A%20Type%20Display%22
In Discussionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Suggestionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.