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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 02:12:57 PDT 2018


sammccall added a comment.

I think you also need to update SymbolsYAML and Serialization.



================
Comment at: clangd/Protocol.cpp:520
     Result["additionalTextEdits"] = json::Array(CI.additionalTextEdits);
+  if (CI.deprecated)
+    Result["deprecated"] = CI.deprecated;
----------------
do we actually want this in JSON?
(genuinely unsure - any clients aware of this extension?)


================
Comment at: clangd/Protocol.h:771
 
+  /// Indicates if this item is deprecated.
+  bool deprecated = false;
----------------
this is a clangd extension.
(right?)


================
Comment at: clangd/index/Index.h:249
+  /// FIXME: also add deprecation message and fixit?
+  bool Deprecated = false;
 };
----------------
would you mind packing this together with IsIndexedForCompletion, for memory size?
either as an actual bitfield `bool Deprecated : 1 = false` or as enum flags `enum Flags : uint8_t { IndexedForCompletion, Deprecated, }; Flags flags`

The latter will simplify life for serialization, but up to you.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51724





More information about the cfe-commits mailing list