[PATCH] D64202: [clangd] Some tweaks on semantic highlighting lookuptable.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 4 05:10:11 PDT 2019


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:87
+// to the LSP client.
+std::vector<std::vector<std::string>> buildTextMateScopeLookupTable() {
+  std::vector<std::vector<std::string>> LookupTable;
----------------
while here, can we have "highlight" in the name? like "buildHighlightScopeLookupTable"?


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:161
+    return "variable.cpp";
+  default:
+    break;
----------------
use `case Last` instead of `default` for better warnings.
https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.h:30
+
+  Last, // placeholder for last value.
 };
----------------
the name is a little confusing as it's last-plus-one. NumKinds is a common idiom I think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64202/new/

https://reviews.llvm.org/D64202





More information about the cfe-commits mailing list