Title: comments following shebang are not recognised · Issue #28477 · microsoft/TypeScript · GitHub
Open Graph Title: comments following shebang are not recognised · Issue #28477 · microsoft/TypeScript
X Title: comments following shebang are not recognised · Issue #28477 · microsoft/TypeScript
Description: TypeScript Version: 3.2.0-dev.20181101 Search Terms: shebang comment Code #! node /** text */ const v = 1; Expected behavior: Hovering v should show the JSDoc comment's text. Actual behavior: Doesn't show the JSDoc. In fact ts.forEachLea...
Open Graph Description: TypeScript Version: 3.2.0-dev.20181101 Search Terms: shebang comment Code #! node /** text */ const v = 1; Expected behavior: Hovering v should show the JSDoc comment's text. Actual behavior: Doesn...
X Description: TypeScript Version: 3.2.0-dev.20181101 Search Terms: shebang comment Code #! node /** text */ const v = 1; Expected behavior: Hovering v should show the JSDoc comment's text. Actual behavior: D...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"comments following shebang are not recognised","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.2.0-dev.20181101\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:** shebang comment\r\n\r\n**Code**\r\n\r\n```ts\r\n#! node\r\n/** text */\r\nconst v = 1;\r\n```\r\n\r\n**Expected behavior:**\r\nHovering `v` should show the JSDoc comment's text.\r\n\r\n**Actual behavior:**\r\nDoesn't show the JSDoc. In fact `ts.forEachLeadingCommentRange` and `ts.forEachTrailingCommentRange` aborts when encountering the shebang, so no comments are recognised.\r\n\r\nThere are a few places where this issue occurs (the reason is always the same):\r\n* using the compiler API to visit or get comments\r\n* retrieving JSDoc of a declaration\r\n* declaration emitter looking for `// @internal` comments\r\n\r\n**Playground Link:** https://agentcooper.github.io/typescript-play/#code/MQQgBAdg9gJgpgKAPQCoVgC5wB4bCpBAYyggGc8A3MAXjAEYBuIA\r\nDropping in an empty statement after the shebang fixes the issue: https://agentcooper.github.io/typescript-play/#code/MQQgBAdg9gJgpgKANwIPQCp1gC5wB7ZjqoIDGUEAzoQG5gC8YAjEkA\r\n\r\n\r\nI'd like to submit a PR to fix the scanner if you accept this bug.\r\n","author":{"url":"https://github.com/ajafff","@type":"Person","name":"ajafff"},"datePublished":"2018-11-11T21:07:51Z","url":"https://github.com/microsoft/TypeScript/issues/28477"}
| 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:22960df4-1547-4d54-8c3d-2024b40efd84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7D0:20AA01:2E81DED:3B1A783:6B01AA2B |
| html-safe-nonce | c02c6e4278647b854051004370a33435b35f41b1a05593dcc0ab05d38a57f94c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0QwOjIwQUEwMToyRTgxREVEOjNCMUE3ODM6NkIwMUFBMkIiLCJ2aXNpdG9yX2lkIjoiNjcyODgwMzE0MTMzODM3Njc0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3fd5cbae637919f2b6588d071359e02f3f9bb71cc4e507d6bd040e5c64f9db23 |
| hovercard-subject-tag | issue:379563416 |
| 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/28477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f0238ff3029f5f8a3527186c3c562848a969adb80f4ba5573b08e80f7c8de570/microsoft/TypeScript/issues/28477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f0238ff3029f5f8a3527186c3c562848a969adb80f4ba5573b08e80f7c8de570/microsoft/TypeScript/issues/28477 |
| og:image:alt | TypeScript Version: 3.2.0-dev.20181101 Search Terms: shebang comment Code #! node /** text */ const v = 1; Expected behavior: Hovering v should show the JSDoc comment's text. Actual behavior: Doesn... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ajafff |
| 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