Title: Add "related spans" to diagnostic messages · Issue #10489 · microsoft/TypeScript · GitHub
Open Graph Title: Add "related spans" to diagnostic messages · Issue #10489 · microsoft/TypeScript
X Title: Add "related spans" to diagnostic messages · Issue #10489 · microsoft/TypeScript
Description: We already have --pretty error message output, but we can do even better. In this blog post jonathandturner describes a set of improvements to Rust's error message framework to allow for an error to specify related spans, other than the ...
Open Graph Description: We already have --pretty error message output, but we can do even better. In this blog post jonathandturner describes a set of improvements to Rust's error message framework to allow for an error t...
X Description: We already have --pretty error message output, but we can do even better. In this blog post jonathandturner describes a set of improvements to Rust's error message framework to allow for an err...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/10489
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add \"related spans\" to diagnostic messages","articleBody":"We already have `--pretty` error message output, but we can do _even better_. In [this blog post](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html) @jonathandturner describes a set of improvements to Rust's error message framework to allow for an error to specify related spans, other than the primary span where the error was encountered - _and_ to provide extra elaboration on each of those spans. This is incredibly useful, and we can do the same.\n\nFor example, when we report a duplicate definition error, in the diagnostic object, we could return the spans for the secondary declaration locations in the diagnostics object (potentially with [elaboration](http://elm-lang.org/blog/compiler-errors-for-humans) on how they are a duplicate hidden behind a `--elaborate` flag). Missing member errors can have a reference back to the type definition (since the error is equally likely to be fixed there). Type errors on assignments can reference back to the declaration of the LHS. There's probably countless errors where we could refer to a secondary location where either a type is likely wrong and causing the error or where the error is likely to be fixed. On the command line, this can just be surfaced as part of the current `pretty` output, and inside vscode we could potentially coordinate to cause additional related spans to cause a code window to appear in the details popover.\n","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2016-08-23T02:40:57Z","url":"https://github.com/microsoft/TypeScript/issues/10489"}
| 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:a65b06ac-3642-7b72-19b2-8c398528a5ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA9A:BBAAA:AE04D2:E75714:6B00EB64 |
| html-safe-nonce | 33311aed28f90ce09a50414ff5adbe504c4cd44a914083fbf42d89f59b5929dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTlBOkJCQUFBOkFFMDREMjpFNzU3MTQ6NkIwMEVCNjQiLCJ2aXNpdG9yX2lkIjoiNTk2OTA2OTc2MDc4MzExNzE1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 88a2ac676d0b7c878339c8f1e6b152eed848a773a4d44c5470b81db5d5dfae80 |
| hovercard-subject-tag | issue:172599964 |
| 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/10489/issue_layout |
| twitter:image | https://opengraph.githubassets.com/767d790fefaf2b360436fa52f0066e97e5db51f2ab37baa44ae7745eb3aa6b73/microsoft/TypeScript/issues/10489 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/767d790fefaf2b360436fa52f0066e97e5db51f2ab37baa44ae7745eb3aa6b73/microsoft/TypeScript/issues/10489 |
| og:image:alt | We already have --pretty error message output, but we can do even better. In this blog post jonathandturner describes a set of improvements to Rust's error message framework to allow for an error t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width