9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H
21 #include "llvm/ADT/Optional.h"
22 #include "llvm/Support/JSON.h"
80 void onDiagnosticsReady(
PathRef File, llvm::StringRef Version,
84 void onSemanticsMaybeChanged(
PathRef File)
override;
109 Callback<std::vector<FoldingRange>>);
124 Callback<llvm::Optional<URIForFile>>);
126 Callback<std::vector<DocumentHighlight>>);
129 Callback<std::vector<SymbolInformation>>);
136 Callback<llvm::Optional<TypeHierarchyItem>>);
138 Callback<llvm::Optional<TypeHierarchyItem>>);
140 Callback<std::vector<CallHierarchyItem>>);
141 void onCallHierarchyIncomingCalls(
143 Callback<std::vector<CallHierarchyIncomingCall>>);
144 void onCallHierarchyOutgoingCalls(
146 Callback<std::vector<CallHierarchyOutgoingCall>>);
152 Callback<std::vector<SymbolDetails>>);
154 Callback<std::vector<SelectionRange>>);
156 Callback<std::vector<DocumentLink>>);
177 CreateWorkDoneProgress;
179 BeginWorkDoneProgress;
181 ReportWorkDoneProgress;
202 void maybeExportMemoryProfile();
207 void maybeCleanupMemory();
218 bool ShutdownRequestReceived =
false;
221 std::atomic<bool> IsBeingDestroyed = {
false};
223 std::mutex FixItsMutex;
225 DiagnosticToReplacementMap;
227 llvm::StringMap<DiagnosticToReplacementMap> FixItsMap;
229 std::mutex SemanticTokensMutex;
230 llvm::StringMap<SemanticTokens> LastSemanticTokens;
235 class MessageHandler;
236 std::unique_ptr<MessageHandler> MsgHandler;
237 std::mutex TranspWriter;
253 bool SupportsCodeAction =
false;
255 bool SupportsHierarchicalDocumentSymbol =
false;
257 bool SupportFileStatus =
false;
261 bool SupportsOffsetsInSignatureHelp =
false;
262 std::mutex BackgroundIndexProgressMutex;
263 enum class BackgroundIndexProgress {
274 } BackgroundIndexProgressState = BackgroundIndexProgress::Unsupported;
277 BackgroundQueue::Stats PendingBackgroundIndexProgress;
279 bool BackgroundIndexSkipCreate =
false;
283 std::unique_ptr<GlobalCompilationDatabase> BaseCDB;
285 llvm::Optional<OverlayCDB> CDB;
287 llvm::Optional<ClangdServer> Server;
292 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H