[PATCH] D69165: [clangd] Store Index in Tweak::Selection

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 01:07:04 PDT 2019


ilya-biryukov added a comment.

Overall LG, just a few quick questions.



================
Comment at: clang-tools-extra/clangd/refactor/Tweak.h:65
     SelectionTree ASTSelection;
+    /// The Index being used by ClangdServer.
+    const SymbolIndex *Index = nullptr;
----------------
NIT: Let's avoid mentioning `ClangdServer` here. `ClangdServer` is a "glue" that brings things like tweaks, code completion and other code together... Mentioning it here is sort of a "reverse" dependency...


================
Comment at: clang-tools-extra/clangd/refactor/Tweak.h:66
+    /// The Index being used by ClangdServer.
+    const SymbolIndex *Index = nullptr;
     // FIXME: provide a way to get sources and ASTs for other files.
----------------
NIT: Maybe put it right before `ParsedAST`?


================
Comment at: clang-tools-extra/clangd/unittests/TweakTesting.h:71
+  // Index to be passed into Tweak::Selection.
+  const SymbolIndex *Index = nullptr;
+
----------------
How is this index populated? Each test has to mock it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69165





More information about the cfe-commits mailing list