Title: Change to references' lineText property breaks find-all-references in emacs · Issue #25489 · microsoft/TypeScript · GitHub
Open Graph Title: Change to references' lineText property breaks find-all-references in emacs · Issue #25489 · microsoft/TypeScript
X Title: Change to references' lineText property breaks find-all-references in emacs · Issue #25489 · microsoft/TypeScript
Description: var g = function (x) { console.log(x) return x/**/ } Find all references at x (any of them) in emacs. Expected behavior: Three lines: test.js 6:var g = function (x) { 7: console.log(x) 8: return x Actual behavior: Crash with emacs' inscr...
Open Graph Description: var g = function (x) { console.log(x) return x/**/ } Find all references at x (any of them) in emacs. Expected behavior: Three lines: test.js 6:var g = function (x) { 7: console.log(x) 8: return x ...
X Description: var g = function (x) { console.log(x) return x/**/ } Find all references at x (any of them) in emacs. Expected behavior: Three lines: test.js 6:var g = function (x) { 7: console.log(x) 8: return x ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/25489
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change to references' lineText property breaks find-all-references in emacs","articleBody":"```ts\r\nvar g = function (x) {\r\n console.log(x)\r\n return x/**/\r\n}\r\n```\r\n\r\nFind all references at x (any of them) in emacs.\r\n\r\n**Expected behavior:**\r\nThree lines:\r\n\r\n```\r\ntest.js\r\n 6:var g = function (x) {\r\n 7: console.log(x)\r\n 8: return x\r\n```\r\n\r\n**Actual behavior:**\r\nCrash with emacs' inscrutable equivalent of index out of bounds (\"let: Args out of range: 18, 19\"). Deleting the body of `tide-annotate-line` stops the crash and exposes the real problem:\r\n\r\n```\r\ntest.js\r\n 6:x\r\n 7:x\r\n 8:x\r\n```\r\n\r\nlineText was previously the entire line text and is now just the text of the identifier. I am pretty sure that #25283 caused this change. I *think* it is unintentional and incorrect based on the description in protocol.ts:\r\n\r\n```ts\r\n /** Text of line containing the reference. Including this\r\n * with the response avoids latency of editor loading files\r\n * to show text of reference line (the server already has\r\n * loaded the referencing files).\r\n */\r\n lineText: string;\r\n```\r\n\r\nActually setting up emacs + tide + custom tsserver + custom logger is cumbersome and probably not necessary. Here is the before/after json object for this request:\r\n\r\n## 2.9.2\r\n\r\n```json\r\n{\"seq\":0,\"type\":\"response\",\"command\":\"references\",\"request_seq\":\"200\",\"success\":true,\"body\":{\"refs\":[\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":6,\"offset\":19},\"lineText\":\"var g = function (x) {\",\"end\":{\"line\":6,\"offset\":20},\"isWriteAccess\":true,\"isDefinition\":true},\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":7,\"offset\":17},\"lineText\":\" console.log(x);\",\"end\":{\"line\":7,\"offset\":18},\"isWriteAccess\":false,\"isDefinition\":false},\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":8,\"offset\":12},\"lineText\":\" return x }\",\"end\":{\"line\":8,\"offset\":13},\"isWriteAccess\":false,\"isDefinition\":false}],\"symbolName\":\"x\",\"symbolStartOffset\":12,\"symbolDisplayString\":\"(parameter) x: HTMLElement\"}}\r\n```\r\n\r\n## 3.0\r\n```\r\n{\"seq\":0,\"type\":\"response\",\"command\":\"references\",\"request_seq\":\"203\",\"success\":true,\"body\":{\"refs\":[\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":6,\"offset\":19},\"end\":{\"line\":6,\"offset\":20},\"lineText\":\"x\",\"isWriteAccess\":true,\"isDefinition\":true},\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":7,\"offset\":17},\"end\":{\"line\":7,\"offset\":18},\"lineText\":\"x\",\"isWriteAccess\":false,\"isDefinition\":false},\r\n {\"file\":\"/home/n/src/test/test.js\",\"start\":{\"line\":8,\"offset\":12},\"end\":{\"line\":8,\"offset\":13},\"lineText\":\"x\",\"isWriteAccess\":false,\"isDefinition\":false}],\"symbolName\":\"x\",\"symbolStartOffset\":12,\"symbolDisplayString\":\"(parameter) x: HTMLElement\"}}\r\n```","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2018-07-06T22:10:13Z","url":"https://github.com/microsoft/TypeScript/issues/25489"}
| 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:40fb3e22-6643-838e-9ab8-5a8a9d3e650a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E812:2BE220:1F96222:2A1ADD3:6B017CAC |
| html-safe-nonce | f245c6288bd7a6089d4d2cfeac3fd5d2b942055e35f563159438c28086942fab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODEyOjJCRTIyMDoxRjk2MjIyOjJBMUFERDM6NkIwMTdDQUMiLCJ2aXNpdG9yX2lkIjoiMTIzMDk1ODgyNDQ5MjQ2NTMyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7b55e7354749a5899af5b3d48abb02fa5f61a3930b1b190213bc38a132f35210 |
| hovercard-subject-tag | issue:339084640 |
| 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/25489/issue_layout |
| twitter:image | https://opengraph.githubassets.com/68cf72e310e02dba6feccd4aa3842081191f2c3d3d36b511128a3bfea1420f38/microsoft/TypeScript/issues/25489 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/68cf72e310e02dba6feccd4aa3842081191f2c3d3d36b511128a3bfea1420f38/microsoft/TypeScript/issues/25489 |
| og:image:alt | var g = function (x) { console.log(x) return x/**/ } Find all references at x (any of them) in emacs. Expected behavior: Three lines: test.js 6:var g = function (x) { 7: console.log(x) 8: return x ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandersn |
| 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