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

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 6 06:47:18 PDT 2018


ioeric added inline comments.


================
Comment at: clangd/Protocol.cpp:520
     Result["additionalTextEdits"] = json::Array(CI.additionalTextEdits);
+  if (CI.deprecated)
+    Result["deprecated"] = CI.deprecated;
----------------
sammccall wrote:
> do we actually want this in JSON?
> (genuinely unsure - any clients aware of this extension?)
This is actually defined in LSP: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#completion-request-leftwards_arrow_with_hook


================
Comment at: clangd/index/Index.h:249
+  /// FIXME: also add deprecation message and fixit?
+  bool Deprecated = false;
 };
----------------
sammccall wrote:
> 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.
Done. Pack them into flags.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51724





More information about the cfe-commits mailing list