Skip to content

Commit bf7c107

Browse files
committed
No NOLINT fix for Error Diagnostic
1 parent 1b0ebe2 commit bf7c107

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,12 @@ filterFastTidyChecks(const tidy::ClangTidyCheckFactories &All,
405405
std::vector<Fix>
406406
clangTidyNoLintFixes(const clang::tidy::ClangTidyContext &CTContext,
407407
const clang::Diagnostic &Info, const Diag &Diag) {
408-
auto RuleName = CTContext.getCheckName(Info.getID());
409-
if (RuleName.empty()) {
410-
return {};
411-
}
412-
if (!Diag.InsideMainFile) {
408+
auto RuleName = CTContext.getCheckName(Diag.ID);
409+
if (RuleName.empty() || Diag.Severity >= DiagnosticsEngine::Error ||
410+
!Diag.InsideMainFile) {
413411
return {};
414412
}
413+
415414
auto &SrcMgr = Info.getSourceManager();
416415
auto &DiagLoc = Info.getLocation();
417416

0 commit comments

Comments
 (0)