-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diagnostic format improvements #2143
Merged
DougGregor
merged 7 commits into
swiftlang:main
from
DougGregor:diagnostic-format-improvements
Sep 5, 2023
Merged
Diagnostic format improvements #2143
DougGregor
merged 7 commits into
swiftlang:main
from
DougGregor:diagnostic-format-improvements
Sep 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…p front One of the usability issues with the new grouped diagnostics code is that the actual error/warning/remark buried within the source code, with only a header like === t.swift:1 === to show where the issue occurs. Instead, display the diagnostic file:line:column and text right up front, the same way as the existing compiler's style, e.g., t.swift:5:3: error: no exact matches in call to global function 'f' The is better for humans, because it puts the primary issue right up front, and also better for tools that scrape logs to find the diagnostics using this form.
…an expansion When the primary diagnostic comes from inside some kind of generated buffer, such as a macro expansion buffer, the file/line/column will point into a source file that might be temporary. In such cases, also add a link to the outermost, original source file, e.g., main.swift:2:1: note: expanded code originates here to help users and tools alike to find that original source file.
Match the existing LLVM style used by the Swift compiler, where the diagnostic severity (warning, note, error) is colorized and bolded, but the diagnostic text is bolded but in the default color. Visually, this is less overwhelming, which is presumably why the compiler has been doing it.
The Swift compiler (and most LLVM-based tools) have a "remark" diagnostic severity. Add support for it into DiagnosticSeverity.
@swift-ci please test |
swiftlang/swift#68289 @swift-ci please test |
ahoppen
reviewed
Sep 2, 2023
swiftlang/swift#68289 @swift-ci please test |
swiftlang/swift#68289 @swift-ci please test Windows |
swiftlang/swift#68289 @swift-ci please test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce a few improvements to make the "grouped" diagnostics more similar to the diagnostics provided by the existing Swift compiler, as a step toward enabling these diagnostics by default:
error
,warning
, etc.) and not the whole diagnostic message, to match the Swift compiler's current style.remark
diagnostic severity, which is used by the Swift compiler and needs to be representable.Example now: