mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] Add a swift-syntax diagnostic style
The SwiftDiagnostics module within swift-syntax has a diagnostic pretty-printer that does a nice rendering of the source code with diagnostics placed inside gaps between the code lines. Introduce another `-diagnostic-style` argument, `swift-syntax`, to bridge from the pretty-printed C++ diagnostics over to the swift-syntax diagnostics engine.
This commit is contained in:
@@ -1466,6 +1466,9 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
|
||||
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::LLVM;
|
||||
} else if (contents == "swift") {
|
||||
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::Swift;
|
||||
} else if (contents == "swift-syntax") {
|
||||
Opts.PrintedFormattingStyle =
|
||||
DiagnosticOptions::FormattingStyle::SwiftSyntax;
|
||||
} else {
|
||||
Diags.diagnose(SourceLoc(), diag::error_unsupported_option_argument,
|
||||
arg->getOption().getPrefixedName(), arg->getValue());
|
||||
|
||||
Reference in New Issue
Block a user