Title: Comments on PropertyDeclaration nodes not honored by the TS transform. · Issue #22497 · microsoft/TypeScript · GitHub
Open Graph Title: Comments on PropertyDeclaration nodes not honored by the TS transform. · Issue #22497 · microsoft/TypeScript
X Title: Comments on PropertyDeclaration nodes not honored by the TS transform. · Issue #22497 · microsoft/TypeScript
Description: TypeScript Version: 2.7.2 Search Terms: PropertyDeclaration Code function addComment(property: ts.PropertyDeclaration): void { ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLevelCommentTrivia, 'this comment will never show u...
Open Graph Description: TypeScript Version: 2.7.2 Search Terms: PropertyDeclaration Code function addComment(property: ts.PropertyDeclaration): void { ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLevelCommen...
X Description: TypeScript Version: 2.7.2 Search Terms: PropertyDeclaration Code function addComment(property: ts.PropertyDeclaration): void { ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLevelCommen...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22497
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Comments on PropertyDeclaration nodes not honored by the TS transform.","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 2.7.2\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** PropertyDeclaration\r\n\r\n**Code**\r\n```\r\nfunction addComment(property: ts.PropertyDeclaration): void {\r\n ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLevelCommentTrivia, 'this comment will never show up');\r\n}\r\n```\r\n**Expected behavior:**\r\n\r\nThe comment appears in the generated JS file.\r\n\r\n**Actual behavior:**\r\n\r\nThe comment is missing from the generated JS file.\r\n\r\n**Playground Link:** n/a\r\n\r\n**Related Issues:**\r\n\r\n**More Info:**\r\n\r\nThe comment is dropped in the `ts.ts` transform function `addInitializedPropertyStatements`. As part of transforming the `PropertyDeclaration` nodes into `Statement`s, their comments are forgotten:\r\n\r\nhttps://github.com/Microsoft/TypeScript/blob/master/src/compiler/transformers/ts.ts#L1219","author":{"url":"https://github.com/alxhub","@type":"Person","name":"alxhub"},"datePublished":"2018-03-12T21:28:05Z","url":"https://github.com/microsoft/TypeScript/issues/22497"}
| 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:8cbaa931-d7c6-8d07-d86a-cb73b2bb1e11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A292:31E99C:19F4E6F:229D448:6B015408 |
| html-safe-nonce | a5e42b6610998cd14922452356733e03a90d3abe4a61a15eb729202c120bce6e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjkyOjMxRTk5QzoxOUY0RTZGOjIyOUQ0NDg6NkIwMTU0MDgiLCJ2aXNpdG9yX2lkIjoiODcwNzE2NTIwNjQ0ODUyNjM0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 57210674b4165f280115c14ae6f11eb12e52b5871d5e566681e7246e844a55b5 |
| hovercard-subject-tag | issue:304546865 |
| 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/22497/issue_layout |
| twitter:image | https://opengraph.githubassets.com/db441f3f668618aee571c18d1aa6476122c372be124a78db788a04afaada7ded/microsoft/TypeScript/issues/22497 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/db441f3f668618aee571c18d1aa6476122c372be124a78db788a04afaada7ded/microsoft/TypeScript/issues/22497 |
| og:image:alt | TypeScript Version: 2.7.2 Search Terms: PropertyDeclaration Code function addComment(property: ts.PropertyDeclaration): void { ts.addSyntheticLeadingComment(property, ts.SyntaxKind.MultiLevelCommen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alxhub |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width