[PATCH] D93546: [clangd][NFC] Improve clangd status messages

Quentin Chateau via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 18 07:59:08 PST 2020


qchateau created this revision.
qchateau added a reviewer: sammccall.
Herald added subscribers: usaxena95, kadircet, arphaman, javed.absar.
qchateau requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang.

clangd actions have various naming schemes, the most
common being PascalCase. This commit applies PascalCase
to all clangd actions, and fix the status rendering
in `renderTUAction` to look more consistent.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93546

Files:
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/TUScheduler.cpp


Index: clang-tools-extra/clangd/TUScheduler.cpp
===================================================================
--- clang-tools-extra/clangd/TUScheduler.cpp
+++ clang-tools-extra/clangd/TUScheduler.cpp
@@ -1184,7 +1184,7 @@
   llvm::SmallVector<std::string, 2> Result;
   switch (PA) {
   case PreambleAction::Building:
-    Result.push_back("parsing includes");
+    Result.push_back("Parsing includes");
     break;
   case PreambleAction::Idle:
     // We handle idle specially below.
@@ -1192,13 +1192,13 @@
   }
   switch (AA.K) {
   case ASTAction::Queued:
-    Result.push_back("file is queued");
+    Result.push_back("File is queued");
     break;
   case ASTAction::RunningAction:
-    Result.push_back("running " + AA.Name);
+    Result.push_back("Running " + AA.Name);
     break;
   case ASTAction::Building:
-    Result.push_back("parsing main file");
+    Result.push_back("Parsing main file");
     break;
   case ASTAction::Idle:
     // We handle idle specially below.
@@ -1206,7 +1206,7 @@
   }
   if (Result.empty())
     return "idle";
-  return llvm::join(Result, ",");
+  return llvm::join(Result, ", ");
 }
 
 } // namespace
Index: clang-tools-extra/clangd/ClangdServer.cpp
===================================================================
--- clang-tools-extra/clangd/ClangdServer.cpp
+++ clang-tools-extra/clangd/ClangdServer.cpp
@@ -621,7 +621,7 @@
                                 File));
   };
 
-  WorkScheduler.runWithAST("Type Hierarchy", File, std::move(Action));
+  WorkScheduler.runWithAST("TypeHierarchy", File, std::move(Action));
 }
 
 void ClangdServer::resolveTypeHierarchy(
@@ -642,7 +642,7 @@
       return CB(InpAST.takeError());
     CB(clangd::prepareCallHierarchy(InpAST->AST, Pos, File));
   };
-  WorkScheduler.runWithAST("Call Hierarchy", File, std::move(Action));
+  WorkScheduler.runWithAST("CallHierarchy", File, std::move(Action));
 }
 
 void ClangdServer::incomingCalls(
@@ -678,7 +678,7 @@
           return CB(InpAST.takeError());
         CB(clangd::getDocumentSymbols(InpAST->AST));
       };
-  WorkScheduler.runWithAST("documentSymbols", File, std::move(Action),
+  WorkScheduler.runWithAST("DocumentSymbols", File, std::move(Action),
                            TUScheduler::InvalidateOnUpdate);
 }
 
@@ -690,7 +690,7 @@
           return CB(InpAST.takeError());
         CB(clangd::getFoldingRanges(InpAST->AST));
       };
-  WorkScheduler.runWithAST("foldingRanges", File, std::move(Action),
+  WorkScheduler.runWithAST("FoldingRanges", File, std::move(Action),
                            TUScheduler::InvalidateOnUpdate);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93546.312800.patch
Type: text/x-patch
Size: 2599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201218/81a51ee1/attachment.bin>


More information about the cfe-commits mailing list