[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 09:34:43 PDT 2018


kadircet added inline comments.


================
Comment at: clangd/index/Index.h:171
+  /// See also isIndexedForCodeCompletion().
+  IsIndexedForCodeCompletion = 1 << 0,
+  /// Indicates if the symbol is deprecated.
----------------
nit: rename to IndexedForCodeCompletion, since it is more of an attribute having is in the name doesn't seem so cool. Instead of the attributes themselves maybe the checkers below should have "is" prefix.


================
Comment at: clangd/index/Index.h:172
+  IsIndexedForCodeCompletion = 1 << 0,
+  /// Indicates if the symbol is deprecated.
+  Deprecated = 1 << 1,
----------------
nit: Add a comment similar to above one leading to Deprecated()?


================
Comment at: clangd/index/Index.h:268
+  /// FIXME: also add deprecation message and fixit?
+  bool Deprecated() const {
+    return static_cast<bool>(Flags & SymbolFlag::Deprecated);
----------------
nit: rename to isDeprecated ?


================
Comment at: unittests/clangd/CodeCompleteTests.cpp:1359
   C.Origin = SymbolOrigin::AST | SymbolOrigin::Static;
+  C.Deprecated = true;
 
----------------
Maybe do this on its own render so that we can have both code paths covered. Just before rendering with `Opts.EnableSnippets = true` below. We can simply set this one render again and check deprecated is set to true.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51724





More information about the cfe-commits mailing list