Skip to content

Commit 209e5ed

Browse files
committed
Revert "Fixing one error"
This reverts commit 17989044ad480628a2f7814674dbe7cd985abd17.
1 parent 0c18e95 commit 209e5ed

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "llvm/ADT/STLExtras.h"
4545
#include "llvm/ADT/StringRef.h"
4646
#include "llvm/Support/Error.h"
47-
#include "llvm/Support/Format.h"
4847
#include "llvm/Support/Path.h"
4948
#include "llvm/Support/raw_ostream.h"
5049
#include <algorithm>
@@ -673,21 +672,6 @@ tryConvertToRename(const Diag *Diag, const Fix &Fix) {
673672
return std::nullopt;
674673
}
675674

676-
// Add NOLINT insert as code actions
677-
std::optional<Fix> tryAddClangTidySuppression(const Diag *Diag) {
678-
if (Diag->Source == Diag::ClangTidy) {
679-
Fix F;
680-
F.Message = llvm::formatv("ignore [{0}] for this line", Diag->Name);
681-
TextEdit &E = F.Edits.emplace_back();
682-
E.newText = llvm::formatv("// NOLINTNEXTLINE({0})\n", Diag->Name);
683-
Position InsertPos = Diag->Range.start;
684-
InsertPos.character = 0;
685-
E.range = {InsertPos, InsertPos};
686-
return F;
687-
}
688-
return std::nullopt;
689-
}
690-
691675
} // namespace
692676

693677
void ClangdServer::codeAction(const CodeActionInputs &Params,
@@ -717,19 +701,14 @@ void ClangdServer::codeAction(const CodeActionInputs &Params,
717701
return nullptr;
718702
};
719703
for (const auto &DiagRef : Params.Diagnostics) {
720-
if (const auto *Diag = FindMatchedDiag(DiagRef)) {
704+
if (const auto *Diag = FindMatchedDiag(DiagRef))
721705
for (const auto &Fix : Diag->Fixes) {
722706
if (auto Rename = tryConvertToRename(Diag, Fix)) {
723707
Result.Renames.emplace_back(std::move(*Rename));
724708
} else {
725709
Result.QuickFixes.push_back({DiagRef, Fix});
726710
}
727711
}
728-
729-
if (auto Fix = tryAddClangTidySuppression(Diag)) {
730-
Result.QuickFixes.push_back({DiagRef, std::move(*Fix)});
731-
}
732-
}
733712
}
734713
}
735714

0 commit comments

Comments
 (0)