[clang] [clang-tools-extra] [clangd] Make clangd run `format::cleanupAroundReplacements()` for all code actions just as clang-tidy does (PR #118569)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 22 14:57:41 PST 2024
================
@@ -149,26 +149,12 @@ class ErrorReporter {
Repl.getLength(), Repl.getReplacementText());
auto &Entry = FileReplacements[R.getFilePath()];
Replacements &Replacements = Entry.Replaces;
- llvm::Error Err = Replacements.add(R);
+ llvm::Error Err = Replacements.addOrMerge(R);
if (Err) {
----------------
llvm-beanz wrote:
nit: I know this was pre-existing, but this is a more idomatic way to use llvm::Error.
```suggestion
if (llvm::Error Err = Replacements.addOrMerge(R)) {
```
https://github.com/llvm/llvm-project/pull/118569
More information about the cfe-commits
mailing list