mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: several improvements on missing switch cases diagnostics. (#8026)
1. Make sure the actions taken by fixits are reflected in diagnostics messages. 2. Issue missing cases diagnostics at the start of the switch statement instead of its end. 3. Use <#code#> instead of <#Code#> in the stub.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "SourceKit/Support/UIdent.h"
|
||||
|
||||
#include "swift/AST/AST.h"
|
||||
#include "swift/AST/ASTPrinter.h"
|
||||
#include "swift/AST/ASTVisitor.h"
|
||||
#include "swift/AST/ASTWalker.h"
|
||||
#include "swift/AST/SourceEntityWalker.h"
|
||||
@@ -1988,7 +1989,7 @@ void SwiftEditorDocument::expandPlaceholder(unsigned Offset, unsigned Length,
|
||||
}
|
||||
if (HasSignature)
|
||||
OS << "in";
|
||||
OS << "\n<#code#>\n";
|
||||
OS << "\n" << getCodePlaceholder() << "\n";
|
||||
OS << "}";
|
||||
}
|
||||
Consumer.handleSourceText(ExpansionStr);
|
||||
|
||||
Reference in New Issue
Block a user