This revision was automatically updated to reflect the committed changes.
Closed by commit rL363843: [clangd] Format changes produced by rename (authored
by ibiryukov, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D63562?vs=205618&id=205635#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63562/new/
https://reviews.llvm.org/D63562
Files:
clang-tools-extra/trunk/clangd/ClangdServer.cpp
Index: clang-tools-extra/trunk/clangd/ClangdServer.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/ClangdServer.cpp
+++ clang-tools-extra/trunk/clangd/ClangdServer.cpp
@@ -285,6 +285,15 @@
auto Changes = renameWithinFile(InpAST->AST, File, Pos, NewName);
if (!Changes)
return CB(Changes.takeError());
+
+ auto Style = getFormatStyleForFile(File, InpAST->Inputs.Contents,
+ InpAST->Inputs.FS.get());
+ if (auto Formatted =
+ cleanupAndFormat(InpAST->Inputs.Contents, *Changes, Style))
+ *Changes = std::move(*Formatted);
+ else
+ elog("Failed to format replacements: {0}", Formatted.takeError());
+
std::vector<TextEdit> Edits;
for (const auto &Rep : *Changes)
Edits.push_back(replacementToEdit(InpAST->Inputs.Contents, Rep));
Index: clang-tools-extra/trunk/clangd/ClangdServer.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/ClangdServer.cpp
+++ clang-tools-extra/trunk/clangd/ClangdServer.cpp
@@ -285,6 +285,15 @@
auto Changes = renameWithinFile(InpAST->AST, File, Pos, NewName);
if (!Changes)
return CB(Changes.takeError());
+
+ auto Style = getFormatStyleForFile(File, InpAST->Inputs.Contents,
+ InpAST->Inputs.FS.get());
+ if (auto Formatted =
+ cleanupAndFormat(InpAST->Inputs.Contents, *Changes, Style))
+ *Changes = std::move(*Formatted);
+ else
+ elog("Failed to format replacements: {0}", Formatted.takeError());
+
std::vector<TextEdit> Edits;
for (const auto &Rep : *Changes)
Edits.push_back(replacementToEdit(InpAST->Inputs.Contents, Rep));
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits