90 void onDiagnosticsReady(
PathRef File, llvm::StringRef Version,
91 llvm::ArrayRef<Diag> Diagnostics)
override;
94 void onSemanticsMaybeChanged(
PathRef File)
override;
96 std::vector<Range> InactiveRegions)
override;
123 Callback<std::vector<FoldingRange>>);
138 Callback<std::optional<URIForFile>>);
140 Callback<std::vector<DocumentHighlight>>);
143 Callback<std::vector<SymbolInformation>>);
150 Callback<std::vector<TypeHierarchyItem>>);
152 Callback<std::optional<std::vector<TypeHierarchyItem>>>);
154 Callback<std::vector<TypeHierarchyItem>>);
160 Callback<std::vector<CallHierarchyItem>>);
161 void onCallHierarchyIncomingCalls(
163 Callback<std::vector<CallHierarchyIncomingCall>>);
164 void onCallHierarchyOutgoingCalls(
166 Callback<std::vector<CallHierarchyOutgoingCall>>);
172 Callback<std::vector<SymbolDetails>>);
174 Callback<std::vector<SelectionRange>>);
176 Callback<std::vector<DocumentLink>>);
199 CreateWorkDoneProgress;
201 BeginWorkDoneProgress;
203 ReportWorkDoneProgress;
212 std::optional<ClangdServer::DiagRef> getDiagRef(StringRef
File,
225 void maybeExportMemoryProfile();
230 void maybeCleanupMemory();
241 bool ShutdownRequestReceived =
false;
244 std::atomic<bool> IsBeingDestroyed = {
false};
250 std::mutex DiagRefMutex;
254 bool operator<(
const DiagKey &Other)
const {
255 return std::tie(Rng, Message) < std::tie(Other.Rng, Other.Message);
258 DiagKey toDiagKey(
const clangd::Diagnostic &LSPDiag) {
259 return {LSPDiag.range, LSPDiag.message};
262 typedef std::map<DiagKey, ClangdServer::DiagRef>
263 DiagnosticToDiagRefMap;
265 llvm::StringMap<DiagnosticToDiagRefMap>
269 std::mutex SemanticTokensMutex;
270 llvm::StringMap<SemanticTokens> LastSemanticTokens;
274 clangd::Transport &Transp;
276 std::unique_ptr<MessageHandler> MsgHandler;
277 std::mutex TranspWriter;
279 void callMethod(StringRef
Method, llvm::json::Value Params,
281 void notify(StringRef
Method, llvm::json::Value Params)
override;
283 LSPBinder::RawHandlers Handlers;
285 const ThreadsafeFS &TFS;
287 ClangdDiagnosticOptions DiagOpts;
293 bool SupportsCompletionLabelDetails =
false;
295 bool SupportsCodeAction =
false;
297 bool SupportsHierarchicalDocumentSymbol =
false;
299 bool SupportFileStatus =
false;
301 bool SupportsReferenceContainer =
false;
305 bool SupportsOffsetsInSignatureHelp =
false;
307 bool SupportsDocumentChanges =
false;
309 bool SupportsChangeAnnotation =
false;
311 std::mutex BackgroundIndexProgressMutex;
312 enum class BackgroundIndexProgress {
323 } BackgroundIndexProgressState = BackgroundIndexProgress::Unsupported;
326 BackgroundQueue::Stats PendingBackgroundIndexProgress;
328 bool BackgroundIndexSkipCreate =
false;
332 std::unique_ptr<GlobalCompilationDatabase> BaseCDB;
334 std::optional<OverlayCDB> CDB;
336 std::optional<ClangdServer> Server;
338 std::optional<ModulesBuilder> ModulesManager;
A context is an immutable container for per-request data that must be propagated through layers that ...