Skip to content

[6.2] [Diagnostics] Use the swift-syntax formatting for invalid source locations, too #80988

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

Conversation

DougGregor
Copy link
Member

  • Explanation: The diagnostics formatter from swift-syntax previously only handled fully-formed diagnostics anchored at a particular syntax node. Therefore, the compiler would fall back to the existing LLVM-based diagnostic formatter for diagnostics that had no source location. Adopt new API in the swift-syntax diagnostics formatter that renders a diagnostic message without requiring source location information, so that we consistently use the swift-syntax formatter when it is selected (which is the default). This provides more consistency among emitted diagnostics.
  • Scope: Only affects printing of diagnostics at <unknown>:0:.
  • Original PRs: [Diagnostics] Use the swift-syntax formatting for invalid source locations, too #80874
  • Risk: Very low; it's the diagnostic printer.
  • Testing: CI.

…tions, too

The diagnostics formatter from swift-syntax previously only handled
fully-formed diagnostics anchored at a particular syntax node.
Therefore, the compiler would fall back to the existing LLVM-based
diagnostic formatter for diagnostics that had no source location.

Adopt new API in the swift-syntax diagnostics formatter that renders a
diagnostic message without requiring source location information, so
that we consistently use the swift-syntax formatter when it is
selected (which is the default).

(cherry picked from commit 235242e)
@DougGregor DougGregor requested a review from a team as a code owner April 22, 2025 14:02
@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#3063

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test platform Windows

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test platform Windows

@DougGregor
Copy link
Member Author

@swift-ci please test Windows

@DougGregor DougGregor merged commit 172229e into swiftlang:release/6.2 Apr 23, 2025
5 checks passed
@DougGregor DougGregor deleted the new-diagnostics-formatter-without-sourceloc-6.2 branch April 23, 2025 03:39
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.

2 participants