[PATCH] D101275: [clangd] Hide inlay hints capability behind a command-line flag

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 26 01:32:32 PDT 2021


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1482
   Bind.method("textDocument/semanticTokens/full/delta", this, &ClangdLSPServer::onSemanticTokensDelta);
-  Bind.method("clangd/inlayHints", this, &ClangdLSPServer::onInlayHints);
+  if (Opts.InlayHints)
+    Bind.method("clangd/inlayHints", this, &ClangdLSPServer::onInlayHints);
----------------
I think we only need to suppress the capability, not the method itself, right?

(This is what we usually do, folding-ranges is different... it's seriously crashy and even then probably should bind regardless)


================
Comment at: clang-tools-extra/clangd/ClangdServer.h:167
+    /// Enable preview of InlayHints feature.
+    bool InlayHints = false;
+
----------------
I think this should go in ClangdLSPServer::Options, again i'm not sure why FoldingRanges does what it does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101275



More information about the cfe-commits mailing list