Bug 23309 – diagnostics: add more expressive endpoints than just error and supplemental

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-08-29T06:18:29Z
Last change time
2024-12-13T19:24:15Z
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#20141 →

Comments

Comment #0 by ibuclaw — 2022-08-29T06:18:29Z
What we have is good enough for simple diagnostics on the console, but there is a attach more useful information to a message, that could be emitted at more verbose diagnostic levels. Where we've seen PRs that try to do something different. - Splitting errors into multiple lines: https://github.com/dlang/dmd/pull/12526 See PR for possible way to do this. - Tagging errors with documentation links (gdc has -fdiagnostics-urls) https://github.com/dlang/dmd/pull/14354 A new diagnostic function could be added that only emits to the console when requested. eg: specSupplemental("lex.html#floatliteral"); Requested features from people in the wild/community/industry. - Underline and use caret in errors (gdc has -fdiagnostics-show-caret) No special endpoint is required, but we would need all expressions to have start and end location ranges for underlining to work properly. - Generating patches in unified diff format for fixing code (gdc has -fdiagnostics-generate-patch) A new diagnostic function could be added for the "did you mean" style errors, passing the location range and suggestion for fixing. eg: hintSupplemental(locstart, locend, "struct"); hintSupplemental(locstart, locend, s.toChars());
Comment #1 by robert.schadek — 2024-12-13T19:24:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20141 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB