|
@@ -378,15 +378,17 @@ void Lexer::lexCommentText(Token &T) {
|
|
if ((Info = Traits.getTypoCorrectCommandInfo(CommandName))) {
|
|
if ((Info = Traits.getTypoCorrectCommandInfo(CommandName))) {
|
|
StringRef CorrectedName = Info->Name;
|
|
StringRef CorrectedName = Info->Name;
|
|
SourceLocation Loc = getSourceLocation(BufferPtr);
|
|
SourceLocation Loc = getSourceLocation(BufferPtr);
|
|
- SourceRange CommandRange(Loc.getLocWithOffset(1),
|
|
|
|
- getSourceLocation(TokenPtr));
|
|
|
|
|
|
+ SourceLocation EndLoc = getSourceLocation(TokenPtr);
|
|
|
|
+ SourceRange FullRange = SourceRange(Loc, EndLoc);
|
|
|
|
+ SourceRange CommandRange(Loc.getLocWithOffset(1), EndLoc);
|
|
Diag(Loc, diag::warn_correct_comment_command_name)
|
|
Diag(Loc, diag::warn_correct_comment_command_name)
|
|
- << CommandName << CorrectedName
|
|
|
|
|
|
+ << FullRange << CommandName << CorrectedName
|
|
<< FixItHint::CreateReplacement(CommandRange, CorrectedName);
|
|
<< FixItHint::CreateReplacement(CommandRange, CorrectedName);
|
|
} else {
|
|
} else {
|
|
formTokenWithChars(T, TokenPtr, tok::unknown_command);
|
|
formTokenWithChars(T, TokenPtr, tok::unknown_command);
|
|
T.setUnknownCommandName(CommandName);
|
|
T.setUnknownCommandName(CommandName);
|
|
- Diag(T.getLocation(), diag::warn_unknown_comment_command_name);
|
|
|
|
|
|
+ Diag(T.getLocation(), diag::warn_unknown_comment_command_name)
|
|
|
|
+ << SourceRange(T.getLocation(), T.getEndLocation());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|