Skip to content

Commit 54eb708

Browse files
committed
[clangd] Remove --inlay-hints flag
Differential Revision: https://reviews.llvm.org/D117036
1 parent 6b22c37 commit 54eb708

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

clang-tools-extra/clangd/ClangdLSPServer.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
576576
{"compilationDatabase", // clangd extension
577577
llvm::json::Object{{"automaticReload", true}}},
578578
{"callHierarchyProvider", true},
579+
{"clangdInlayHintsProvider", true},
579580
};
580581

581582
{
@@ -608,10 +609,6 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
608609
if (Opts.FoldingRanges)
609610
ServerCaps["foldingRangeProvider"] = true;
610611

611-
// FIXME: once inlayHints can be disabled in config, always advertise.
612-
if (Opts.InlayHints)
613-
ServerCaps["clangdInlayHintsProvider"] = true;
614-
615612
std::vector<llvm::StringRef> Commands;
616613
for (llvm::StringRef Command : Handlers.CommandHandlers.keys())
617614
Commands.push_back(Command);

clang-tools-extra/clangd/ClangdLSPServer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ class ClangdLSPServer : private ClangdServer::Callbacks,
6363
return !T.hidden(); // only enable non-hidden tweaks.
6464
};
6565

66-
/// Enable InlayHints feature.
67-
bool InlayHints = true;
68-
6966
/// Limit the number of references returned (0 means no limit).
7067
size_t ReferencesLimit = 0;
7168
};

clang-tools-extra/clangd/tool/ClangdMain.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "index/ProjectAware.h"
2424
#include "index/Serialization.h"
2525
#include "index/remote/Client.h"
26-
#include "refactor/Rename.h"
2726
#include "support/Path.h"
2827
#include "support/Shutdown.h"
2928
#include "support/ThreadCrashReporter.h"
@@ -294,6 +293,7 @@ RetiredFlag<bool> AsyncPreamble("async-preamble");
294293
RetiredFlag<bool> CollectMainFileRefs("collect-main-file-refs");
295294
RetiredFlag<bool> CrossFileRename("cross-file-rename");
296295
RetiredFlag<std::string> ClangTidyChecks("clang-tidy-checks");
296+
RetiredFlag<std::string> InlayHints("inlay-hints");
297297

298298
opt<int> LimitResults{
299299
"limit-results",
@@ -327,15 +327,6 @@ opt<bool> FoldingRanges{
327327
Hidden,
328328
};
329329

330-
opt<bool> InlayHints{
331-
"inlay-hints",
332-
cat(Features),
333-
desc("Enable InlayHints feature"),
334-
init(ClangdLSPServer::Options().InlayHints),
335-
// FIXME: allow inlayHints to be disabled in Config and remove this option.
336-
Hidden,
337-
};
338-
339330
opt<unsigned> WorkerThreadsCount{
340331
"j",
341332
cat(Misc),
@@ -884,7 +875,6 @@ clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment var
884875
}
885876
Opts.AsyncThreadsCount = WorkerThreadsCount;
886877
Opts.FoldingRanges = FoldingRanges;
887-
Opts.InlayHints = InlayHints;
888878
Opts.MemoryCleanup = getMemoryCleanupFunction();
889879

890880
Opts.CodeComplete.IncludeIneligibleResults = IncludeIneligibleResults;

0 commit comments

Comments
 (0)