clang-tools 20.0.0git
Public Member Functions | List of all members
clang::clangd::ClangdServer::Callbacks Class Reference

Interface with hooks for users of ClangdServer to be notified of events. More...

#include <ClangdServer.h>

Inheritance diagram for clang::clangd::ClangdServer::Callbacks:
Inheritance graph
[legend]

Public Member Functions

virtual ~Callbacks ()=default
 
virtual void onDiagnosticsReady (PathRef File, llvm::StringRef Version, llvm::ArrayRef< Diag > Diagnostics)
 Called by ClangdServer when Diagnostics for File are ready.
 
virtual void onFileUpdated (PathRef File, const TUStatus &Status)
 Called whenever the file status is updated.
 
virtual void onBackgroundIndexProgress (const BackgroundQueue::Stats &Stats)
 Called when background indexing tasks are enqueued/started/completed.
 
virtual void onSemanticsMaybeChanged (PathRef File)
 Called when the meaning of a source code may have changed without an edit.
 
virtual void onInactiveRegionsReady (PathRef File, std::vector< Range > InactiveRegions)
 Called by ClangdServer when some InactiveRegions for File are ready.
 

Detailed Description

Interface with hooks for users of ClangdServer to be notified of events.

Definition at line 62 of file ClangdServer.h.

Constructor & Destructor Documentation

◆ ~Callbacks()

virtual clang::clangd::ClangdServer::Callbacks::~Callbacks ( )
virtualdefault

Member Function Documentation

◆ onBackgroundIndexProgress()

virtual void clang::clangd::ClangdServer::Callbacks::onBackgroundIndexProgress ( const BackgroundQueue::Stats Stats)
inlinevirtual

Called when background indexing tasks are enqueued/started/completed.

Not called concurrently.

Definition at line 79 of file ClangdServer.h.

Referenced by clang::clangd::ClangdServer::ClangdServer().

◆ onDiagnosticsReady()

virtual void clang::clangd::ClangdServer::Callbacks::onDiagnosticsReady ( PathRef  File,
llvm::StringRef  Version,
llvm::ArrayRef< Diag Diagnostics 
)
inlinevirtual

Called by ClangdServer when Diagnostics for File are ready.

These pushed diagnostics might correspond to an older version of the file, they do not interfere with "pull-based" ClangdServer::diagnostics. May be called concurrently for separate files, not for a single file.

Definition at line 70 of file ClangdServer.h.

Referenced by clang::clangd::ClangdServer::createConfiguredContextProvider().

◆ onFileUpdated()

virtual void clang::clangd::ClangdServer::Callbacks::onFileUpdated ( PathRef  File,
const TUStatus Status 
)
inlinevirtual

Called whenever the file status is updated.

May be called concurrently for separate files, not for a single file.

Definition at line 74 of file ClangdServer.h.

◆ onInactiveRegionsReady()

virtual void clang::clangd::ClangdServer::Callbacks::onInactiveRegionsReady ( PathRef  File,
std::vector< Range InactiveRegions 
)
inlinevirtual

Called by ClangdServer when some InactiveRegions for File are ready.

Definition at line 91 of file ClangdServer.h.

◆ onSemanticsMaybeChanged()

virtual void clang::clangd::ClangdServer::Callbacks::onSemanticsMaybeChanged ( PathRef  File)
inlinevirtual

Called when the meaning of a source code may have changed without an edit.

Usually clients assume that responses to requests are valid until they next edit the file. If they're invalidated at other times, we should tell the client. In particular, when an asynchronous preamble build finishes, we can provide more accurate semantic tokens, so we should tell the client to refresh.

Definition at line 87 of file ClangdServer.h.


The documentation for this class was generated from the following file: