[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 7 08:00:04 PST 2019


ilya-biryukov added inline comments.


================
Comment at: clangd/index/Index.h:232
     /// See also isIndexedForCodeCompletion().
+    /// Note that we don't store completion information (signature, snippet,
+    /// documentation, type, inclues, etc) if the symbol is not indexed for code
----------------
This comment would be most useful beside the mentioned fields themselves. Maybe add it there too? Possibly with a shorter form, since there's no need to mention the field names there.


================
Comment at: clangd/index/SymbolCollector.cpp:543
+
+  if (!(S.Flags & Symbol::IndexedForCodeCompletion))
+    return Insert(S);
----------------
Most of the fields updated at the bottom aren't useful. However, I feel the documentation is actually important, since Sema only has doc comments for the **current** file and the rest are currently expected to be provided by the index.

I'm not sure if we already have the code to query the doc comments via index for member completions. If not, it's an oversight.
In any case, I suggest we **always** store the comments in **dynamic** index. Not storing the comments in the static index is fine, since any data for member completions should be provided by the dynamic index (we see a member in completion ⇒ sema has processed the headers ⇒ the dynamic index should know about those members)


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56314





More information about the cfe-commits mailing list