Skip to content

[Diagnostics] Support diagnostics with no location in the new formatter #80477

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

Closed

Conversation

DougGregor
Copy link
Member

With the swift-syntax Diagnostic machinery now supporting diagnostics that have no associated syntax node (for location information), allow "invalid" source locations to pass in both directions across the diagnostics bridge between the C++ diagnostic machinery and the Swift diagnostic machinery. This eliminates the previous behavior where we would fall back to the LLVM diagnostic printer when there's an invalid source location on a diagnostic.

The end-user-visible change is that we'll now get consistently-rendered diagnostics between ones with source locations and ones without source locations.

With the swift-syntax Diagnostic machinery now supporting diagnostics that
have no associated syntax node (for location information), allow
"invalid" source locations to pass in both directions across the
diagnostics bridge between the C++ diagnostic machinery and the Swift
diagnostic machinery. This eliminates the previous behavior where we
would fall back to the LLVM diagnostic printer when there's an invalid
source location on a diagnostic.

The end-user-visible change is that we'll now get consistently-rendered
diagnostics between ones with source locations and ones without source
locations.
@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#3038

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

Giving up on this in favor of a simpler approach #80874

@DougGregor DougGregor closed this Apr 18, 2025
@DougGregor DougGregor deleted the diagnostic-node-optional branch April 18, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant