command/format: Restructure diagnostic presentation #30331
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on how folks have asked their questions, it seems that our current ordering of summary/snippet/values/detail is causing those skimming the error messages to believe that the "values" portion is the error message, and not read the "detail" part.
We originally placed the snippet immediately after the summary so that it would allow quickly seeing the location of the error, but that goal can still be met by including only a reference to the filename and line number up top, and then keeping the full snippet for later in the message.
This does make the diagnostic messages slightly longer, by introducing a few new lines where one of them is slightly redundant, but it also makes the most relevant information -- the details of the diagnostic -- closer to the top and thus hopefully more likely to be read first by those who are skimming the messages, rather than reading them in detail.
This is just a draft for now, because if we decide to go forward with it we'll need to spend a non-trivial amount of effort updating all of the tests for this, and so we want to make sure it's a good direction first before spending that time.