[clang-tools-extra] 54eb708 - [clangd] Remove --inlay-hints flag

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 13 01:02:37 PST 2022


Author: Sam McCall
Date: 2022-01-13T10:02:28+01:00
New Revision: 54eb70886cda06c66122f346520cee7cc6113975

URL: https://github.com/llvm/llvm-project/commit/54eb70886cda06c66122f346520cee7cc6113975
DIFF: https://github.com/llvm/llvm-project/commit/54eb70886cda06c66122f346520cee7cc6113975.diff

LOG: [clangd] Remove --inlay-hints flag

Differential Revision: https://reviews.llvm.org/D117036

Added: 
    

Modified: 
    clang-tools-extra/clangd/ClangdLSPServer.cpp
    clang-tools-extra/clangd/ClangdLSPServer.h
    clang-tools-extra/clangd/tool/ClangdMain.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index 76e3806f421e..47bde7d0edcf 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -576,6 +576,7 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
       {"compilationDatabase",        // clangd extension
        llvm::json::Object{{"automaticReload", true}}},
       {"callHierarchyProvider", true},
+      {"clangdInlayHintsProvider", true},
   };
 
   {
@@ -608,10 +609,6 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
   if (Opts.FoldingRanges)
     ServerCaps["foldingRangeProvider"] = true;
 
-  // FIXME: once inlayHints can be disabled in config, always advertise.
-  if (Opts.InlayHints)
-    ServerCaps["clangdInlayHintsProvider"] = true;
-
   std::vector<llvm::StringRef> Commands;
   for (llvm::StringRef Command : Handlers.CommandHandlers.keys())
     Commands.push_back(Command);

diff  --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h
index 0a5af762ad32..d2b447e75dba 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.h
+++ b/clang-tools-extra/clangd/ClangdLSPServer.h
@@ -63,9 +63,6 @@ class ClangdLSPServer : private ClangdServer::Callbacks,
       return !T.hidden(); // only enable non-hidden tweaks.
     };
 
-    /// Enable InlayHints feature.
-    bool InlayHints = true;
-
     /// Limit the number of references returned (0 means no limit).
     size_t ReferencesLimit = 0;
   };

diff  --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 8cd6b2d760aa..fc448c2c235c 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -23,7 +23,6 @@
 #include "index/ProjectAware.h"
 #include "index/Serialization.h"
 #include "index/remote/Client.h"
-#include "refactor/Rename.h"
 #include "support/Path.h"
 #include "support/Shutdown.h"
 #include "support/ThreadCrashReporter.h"
@@ -294,6 +293,7 @@ RetiredFlag<bool> AsyncPreamble("async-preamble");
 RetiredFlag<bool> CollectMainFileRefs("collect-main-file-refs");
 RetiredFlag<bool> CrossFileRename("cross-file-rename");
 RetiredFlag<std::string> ClangTidyChecks("clang-tidy-checks");
+RetiredFlag<std::string> InlayHints("inlay-hints");
 
 opt<int> LimitResults{
     "limit-results",
@@ -327,15 +327,6 @@ opt<bool> FoldingRanges{
     Hidden,
 };
 
-opt<bool> InlayHints{
-    "inlay-hints",
-    cat(Features),
-    desc("Enable InlayHints feature"),
-    init(ClangdLSPServer::Options().InlayHints),
-    // FIXME: allow inlayHints to be disabled in Config and remove this option.
-    Hidden,
-};
-
 opt<unsigned> WorkerThreadsCount{
     "j",
     cat(Misc),
@@ -884,7 +875,6 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
   }
   Opts.AsyncThreadsCount = WorkerThreadsCount;
   Opts.FoldingRanges = FoldingRanges;
-  Opts.InlayHints = InlayHints;
   Opts.MemoryCleanup = getMemoryCleanupFunction();
 
   Opts.CodeComplete.IncludeIneligibleResults = IncludeIneligibleResults;


        


More information about the cfe-commits mailing list