Description
This is a tracking issue for the prioritizing "verbose" or "hidden" suggestions over "inline" (the default given by span_suggestion
suggestions.
Inline suggestions have several issues that make them less readable than verbose ones:
- I've seen people get confused by them
- Small differences caused by typos are much better seen on the verbose output, where the highlighting now points at the exact character, instead of having to visually notice the different text in non-aligned places
- The inline output was the original implementation, but since we've introduced the diff output which is clearer on what we expect the user to write
- For additions, things like "add a type parameter: " are even more unclear
- Relying on the inline suggestions have lead us to use worse spans on purpose because otherwise the rendering would be bad (like skipping whitespace in some cases) and has a tendency to make suggestion mistakes harder to notice (broken suggestions making it in because we couldn't tell during review)
- When a single suggestion is in the diagnostic, the default renders inline, but if there are two, then both get rendered as verbose, which makes the output sometimes sensitive to what was emitted and can cause two similar errors to look very different.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Audit all cases of
span_suggestion
uses. - Adjust individual cases to be either
span_suggestion_verbose
,span_suggestion_hidden
orspan_suggestion_tool_only
- Change
span_suggestion
tospan_suggestion_inline
andspan_suggestion_verbose
tospan_suggestion
Implementation history
- Make some suggestions "verbose" #137343
- Include whitespace in "remove |" suggestion and make it hidden #137872
- Structured suggestion for
extern crate foo
whenfoo
isn't resolved in import #128151 - Fix "missing match arm body" suggestion involving
!
#137435 - Fix incorrect
cfg
structured suggestion and make suggestion verbose #137773 - Tweak auto trait errors #137831
- Tweak invalid RTN errors #137824
- Make inline suggestions no longer be the default #127282