clang-tools 20.0.0git
|
Manages a collection of source files and derived data (ASTs, indexes), and provides language-aware features such as code completion. More...
#include <ClangdServer.h>
Classes | |
class | Callbacks |
Interface with hooks for users of ClangdServer to be notified of events. More... | |
struct | CodeActionInputs |
struct | CodeActionResult |
struct | DiagRef |
struct | Options |
struct | TweakRef |
Public Member Functions | |
ClangdServer (const GlobalCompilationDatabase &CDB, const ThreadsafeFS &TFS, const Options &Opts, Callbacks *Callbacks=nullptr) | |
Creates a new ClangdServer instance. | |
~ClangdServer () | |
template<typename Mod > | |
Mod * | featureModule () |
Gets the installed feature module of a given type, if any. | |
template<typename Mod > | |
const Mod * | featureModule () const |
void | addDocument (PathRef File, StringRef Contents, llvm::StringRef Version="null", WantDiagnostics WD=WantDiagnostics::Auto, bool ForceRebuild=false) |
Add a File to the list of tracked C++ files or update the contents if File is already tracked. | |
void | removeDocument (PathRef File) |
Remove File from list of tracked files, schedule a request to free resources associated with it. | |
void | reparseOpenFilesIfNeeded (llvm::function_ref< bool(llvm::StringRef File)> Filter) |
Requests a reparse of currently opened files using their latest source. | |
void | codeComplete (PathRef File, Position Pos, const clangd::CodeCompleteOptions &Opts, Callback< CodeCompleteResult > CB) |
Run code completion for File at Pos . | |
void | signatureHelp (PathRef File, Position Pos, MarkupKind DocumentationFormat, Callback< SignatureHelp > CB) |
Provide signature help for File at Pos . | |
void | locateSymbolAt (PathRef File, Position Pos, Callback< std::vector< LocatedSymbol > > CB) |
Find declaration/definition locations of symbol at a specified position. | |
void | switchSourceHeader (PathRef Path, Callback< std::optional< clangd::Path > > CB) |
Switch to a corresponding source file when given a header file, and vice versa. | |
void | findDocumentHighlights (PathRef File, Position Pos, Callback< std::vector< DocumentHighlight > > CB) |
Get document highlights for a given position. | |
void | findHover (PathRef File, Position Pos, Callback< std::optional< HoverInfo > > CB) |
Get code hover for a given position. | |
void | typeHierarchy (PathRef File, Position Pos, int Resolve, TypeHierarchyDirection Direction, Callback< std::vector< TypeHierarchyItem > > CB) |
Get information about type hierarchy for a given position. | |
void | superTypes (const TypeHierarchyItem &Item, Callback< std::optional< std::vector< TypeHierarchyItem > > > CB) |
Get direct parents of a type hierarchy item. | |
void | subTypes (const TypeHierarchyItem &Item, Callback< std::vector< TypeHierarchyItem > > CB) |
Get direct children of a type hierarchy item. | |
void | resolveTypeHierarchy (TypeHierarchyItem Item, int Resolve, TypeHierarchyDirection Direction, Callback< std::optional< TypeHierarchyItem > > CB) |
Resolve type hierarchy item in the given direction. | |
void | prepareCallHierarchy (PathRef File, Position Pos, Callback< std::vector< CallHierarchyItem > > CB) |
Get information about call hierarchy for a given position. | |
void | incomingCalls (const CallHierarchyItem &Item, Callback< std::vector< CallHierarchyIncomingCall > >) |
Resolve incoming calls for a given call hierarchy item. | |
void | inlayHints (PathRef File, std::optional< Range > RestrictRange, Callback< std::vector< InlayHint > >) |
Resolve inlay hints for a given document. | |
void | workspaceSymbols (StringRef Query, int Limit, Callback< std::vector< SymbolInformation > > CB) |
Retrieve the top symbols from the workspace matching a query. | |
void | documentSymbols (StringRef File, Callback< std::vector< DocumentSymbol > > CB) |
Retrieve the symbols within the specified file. | |
void | foldingRanges (StringRef File, Callback< std::vector< FoldingRange > > CB) |
Retrieve ranges that can be used to fold code within the specified file. | |
void | findImplementations (PathRef File, Position Pos, Callback< std::vector< LocatedSymbol > > CB) |
Retrieve implementations for virtual method. | |
void | findType (PathRef File, Position Pos, Callback< std::vector< LocatedSymbol > > CB) |
Retrieve symbols for types referenced at Pos . | |
void | findReferences (PathRef File, Position Pos, uint32_t Limit, bool AddContainer, Callback< ReferencesResult > CB) |
Retrieve locations for symbol references. | |
void | formatFile (PathRef File, std::optional< Range > Rng, Callback< tooling::Replacements > CB) |
Run formatting for the File with content Code . | |
void | formatOnType (PathRef File, Position Pos, StringRef TriggerText, Callback< std::vector< TextEdit > > CB) |
Run formatting after TriggerText was typed at Pos in File with content Code . | |
void | prepareRename (PathRef File, Position Pos, std::optional< std::string > NewName, const RenameOptions &RenameOpts, Callback< RenameResult > CB) |
Test the validity of a rename operation. | |
void | rename (PathRef File, Position Pos, llvm::StringRef NewName, const RenameOptions &Opts, Callback< RenameResult > CB) |
Rename all occurrences of the symbol at the Pos in File to NewName . | |
void | codeAction (const CodeActionInputs &Inputs, Callback< CodeActionResult > CB) |
Surface code actions (quick-fixes for diagnostics, or available code tweaks) for a given range in a file. | |
void | applyTweak (PathRef File, Range Sel, StringRef ID, Callback< Tweak::Effect > CB) |
Apply the code tweak with a specified ID . | |
void | onFileEvent (const DidChangeWatchedFilesParams &Params) |
Called when an event occurs for a watched file in the workspace. | |
void | symbolInfo (PathRef File, Position Pos, Callback< std::vector< SymbolDetails > > CB) |
Get symbol info for given position. | |
void | semanticRanges (PathRef File, const std::vector< Position > &Pos, Callback< std::vector< SelectionRange > > CB) |
Get semantic ranges around a specified position in a file. | |
void | documentLinks (PathRef File, Callback< std::vector< DocumentLink > > CB) |
Get all document links in a file. | |
void | semanticHighlights (PathRef File, Callback< std::vector< HighlightingToken > >) |
void | getAST (PathRef File, std::optional< Range > R, Callback< std::optional< ASTNode > > CB) |
Describe the AST subtree for a piece of code. | |
void | customAction (PathRef File, llvm::StringRef Name, Callback< InputsAndAST > Action) |
Runs an arbitrary action that has access to the AST of the specified file. | |
void | diagnostics (PathRef File, Callback< std::vector< Diag > > CB) |
Fetches diagnostics for current version of the File . | |
llvm::StringMap< TUScheduler::FileStats > | fileStats () const |
Returns estimated memory usage and other statistics for each of the currently open files. | |
std::shared_ptr< const std::string > | getDraft (PathRef File) const |
Gets the contents of a currently tracked file. | |
bool | blockUntilIdleForTest (std::optional< double > TimeoutSeconds=10) |
void | profile (MemoryTree &MT) const |
Builds a nested representation of memory used by components. | |
Static Public Member Functions | |
static std::function< Context(PathRef)> | createConfiguredContextProvider (const config::Provider *Provider, ClangdServer::Callbacks *) |
Creates a context provider that loads and installs config. | |
static Options | optsForTest () |
Manages a collection of source files and derived data (ASTs, indexes), and provides language-aware features such as code completion.
The primary client is ClangdLSPServer which exposes these features via the Language Server protocol. ClangdServer may also be embedded directly, though its API is not stable over time.
ClangdServer should be used from a single thread. Many potentially-slow operations have asynchronous APIs and deliver their results on another thread. Such operations support cancellation: if the caller sets up a cancelable context, many operations will notice cancellation and fail early. (ClangdLSPServer uses this to implement $/cancelRequest).
Definition at line 59 of file ClangdServer.h.
clang::clangd::ClangdServer::ClangdServer | ( | const GlobalCompilationDatabase & | CDB, |
const ThreadsafeFS & | TFS, | ||
const Options & | Opts, | ||
Callbacks * | Callbacks = nullptr |
||
) |
Creates a new ClangdServer instance.
ClangdServer uses CDB
to obtain compilation arguments for parsing. Note that ClangdServer only obtains compilation arguments once for each newly added file (i.e., when processing a first call to addDocument) and reuses those arguments for subsequent reparses. However, ClangdServer will check if compilation arguments changed on calls to forceReparse().
Definition at line 214 of file ClangdServer.cpp.
References clang::clangd::BackgroundIndex::Options::ContextProvider, clang::clangd::BackgroundIndexStorage::createDiskBackedStorageFactory(), clang::clangd::File, clang::clangd::ClangdServer::Callbacks::onBackgroundIndexProgress(), clang::clangd::BackgroundIndex::Options::OnProgress, and clang::clangd::BackgroundIndex::Options::ThreadPoolSize.
clang::clangd::ClangdServer::~ClangdServer | ( | ) |
Definition at line 280 of file ClangdServer.cpp.
References FeatureModules, and clang::clangd::Deadline::infinity().
void clang::clangd::ClangdServer::addDocument | ( | PathRef | File, |
StringRef | Contents, | ||
llvm::StringRef | Version = "null" , |
||
WantDiagnostics | WD = WantDiagnostics::Auto , |
||
bool | ForceRebuild = false |
||
) |
Add a File
to the list of tracked C++ files or update the contents if File
is already tracked.
Also schedules parsing of the AST for it on a separate thread. When the parsing is complete, DiagConsumer passed in constructor will receive onDiagnosticsReady callback. Version identifies this snapshot and is propagated to ASTs, preambles, diagnostics etc built from it. If empty, a version number is generated.
Definition at line 294 of file ClangdServer.cpp.
References clang::clangd::DraftStore::addDraft(), clang::clangd::File, and WantDiags.
Referenced by reparseOpenFilesIfNeeded().
void clang::clangd::ClangdServer::applyTweak | ( | PathRef | File, |
Range | Sel, | ||
StringRef | ID, | ||
Callback< Tweak::Effect > | CB | ||
) |
Apply the code tweak with a specified ID
.
Definition at line 738 of file ClangdServer.cpp.
References Action, clang::clangd::trace::Metric::Counter, E, clang::clangd::elog(), clang::clangd::File, clang::clangd::getFormatStyleForFile(), clang::clangd::prepareTweak(), clang::clangd::trace::Metric::record(), and clang::clangd::reformatEdit().
bool clang::clangd::ClangdServer::blockUntilIdleForTest | ( | std::optional< double > | TimeoutSeconds = 10 | ) |
Definition at line 1114 of file ClangdServer.cpp.
References FeatureModules, M, and clang::clangd::timeoutSeconds().
void clang::clangd::ClangdServer::codeAction | ( | const CodeActionInputs & | Inputs, |
Callback< CodeActionResult > | CB | ||
) |
Surface code actions (quick-fixes for diagnostics, or available code tweaks) for a given range in a file.
Definition at line 676 of file ClangdServer.cpp.
References Action, clang::clangd::ClangdServer::CodeActionInputs::Diagnostics, clang::clangd::ClangdServer::CodeActionInputs::File, clang::clangd::Diag::Fixes, Kind, clang::clangd::DiagBase::Message, clang::clangd::prepareTweaks(), clang::clangd::CodeAction::QUICKFIX_KIND, clang::clangd::DiagBase::Range, clang::clangd::ClangdServer::CodeActionInputs::RequestedActionKinds, clang::clangd::ClangdServer::CodeActionInputs::Selection, and clang::clangd::ClangdServer::CodeActionInputs::TweakFilter.
void clang::clangd::ClangdServer::codeComplete | ( | PathRef | File, |
Position | Pos, | ||
const clangd::CodeCompleteOptions & | Opts, | ||
Callback< CodeCompleteResult > | CB | ||
) |
Run code completion for File
at Pos
.
This method should only be called for currently tracked files.
Definition at line 418 of file ClangdServer.cpp.
References clang::clangd::Config::AllScopes, clang::clangd::CodeCompleteOptions::AlwaysParse, clang::clangd::codeComplete(), clang::clangd::Config::Completion, clang::clangd::Config::current(), clang::clangd::File, clang::clangd::isCancelled(), ParseInput, Pos, clang::clangd::TUScheduler::Stale, clang::clangd::TUScheduler::StaleOrAbsent, and clang::clangd::vlog().
|
static |
Creates a context provider that loads and installs config.
Errors in loading config are reported as diagnostics via Callbacks. (This is typically used as ClangdServer::Options::ContextProvider).
Definition at line 337 of file ClangdServer.cpp.
References C, clang::clangd::Context::clone(), clang::clangd::Context::current(), clang::clangd::elog(), clang::clangd::config::Params::FreshTime, clang::clangd::config::Provider::getConfig(), clang::clangd::ClangdServer::Callbacks::onDiagnosticsReady(), clang::clangd::config::Params::Path, clang::clangd::toDiag(), and clang::clangd::vlog().
Referenced by clang::clangd::ClangdLSPServer::ClangdLSPServer().
void clang::clangd::ClangdServer::customAction | ( | PathRef | File, |
llvm::StringRef | Name, | ||
Callback< InputsAndAST > | Action | ||
) |
Runs an arbitrary action that has access to the AST of the specified file.
The action will execute on one of ClangdServer's internal threads. The AST is only valid for the duration of the callback. As with other actions, the file must have been opened.
Definition at line 1093 of file ClangdServer.cpp.
Fetches diagnostics for current version of the File
.
This might fail if server is busy (building a preamble) and would require a long time to prepare diagnostics. If it fails, clients should wait for onSemanticsMaybeChanged and then retry. These 'pulled' diagnostics do not interfere with the diagnostics 'pushed' to Callbacks::onDiagnosticsReady, and clients may use either or both.
Definition at line 1098 of file ClangdServer.cpp.
References Action.
void clang::clangd::ClangdServer::documentLinks | ( | PathRef | File, |
Callback< std::vector< DocumentLink > > | CB | ||
) |
Get all document links in a file.
Definition at line 1025 of file ClangdServer.cpp.
References Action, clang::clangd::File, and clang::clangd::getDocumentLinks().
void clang::clangd::ClangdServer::documentSymbols | ( | StringRef | File, |
Callback< std::vector< DocumentSymbol > > | CB | ||
) |
Retrieve the symbols within the specified file.
Definition at line 930 of file ClangdServer.cpp.
References Action, clang::clangd::File, and clang::clangd::getDocumentSymbols().
|
inline |
Gets the installed feature module of a given type, if any.
This exposes access the public interface of feature modules that have one.
Definition at line 211 of file ClangdServer.h.
References clang::clangd::FeatureModuleSet::get().
|
inline |
Definition at line 214 of file ClangdServer.h.
References clang::clangd::FeatureModuleSet::get().
llvm::StringMap< TUScheduler::FileStats > clang::clangd::ClangdServer::fileStats | ( | ) | const |
Returns estimated memory usage and other statistics for each of the currently open files.
Overall memory usage of clangd may be significantly more than reported here, as this metric does not account (at least) for:
Definition at line 1109 of file ClangdServer.cpp.
void clang::clangd::ClangdServer::findDocumentHighlights | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< DocumentHighlight > > | CB | ||
) |
Get document highlights for a given position.
Definition at line 817 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::findDocumentHighlights(), and Pos.
void clang::clangd::ClangdServer::findHover | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::optional< HoverInfo > > | CB | ||
) |
Get code hover for a given position.
Definition at line 829 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::getFormatStyleForFile(), clang::clangd::getHover(), and Pos.
void clang::clangd::ClangdServer::findImplementations | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< LocatedSymbol > > | CB | ||
) |
Retrieve implementations for virtual method.
Definition at line 969 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::findImplementations(), and Pos.
void clang::clangd::ClangdServer::findReferences | ( | PathRef | File, |
Position | Pos, | ||
uint32_t | Limit, | ||
bool | AddContainer, | ||
Callback< ReferencesResult > | CB | ||
) |
Retrieve locations for symbol references.
Definition at line 981 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::findReferences(), and Pos.
void clang::clangd::ClangdServer::findType | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< LocatedSymbol > > | CB | ||
) |
Retrieve symbols for types referenced at Pos
.
Definition at line 958 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::findType(), and Pos.
void clang::clangd::ClangdServer::foldingRanges | ( | StringRef | File, |
Callback< std::vector< FoldingRange > > | CB | ||
) |
Retrieve ranges that can be used to fold code within the specified file.
Definition at line 942 of file ClangdServer.cpp.
References Action, Code, clang::clangd::File, getDraft(), clang::clangd::getFoldingRanges(), and clang::clangd::InvalidParams.
void clang::clangd::ClangdServer::formatFile | ( | PathRef | File, |
std::optional< Range > | Rng, | ||
Callback< tooling::Replacements > | CB | ||
) |
Run formatting for the File
with content Code
.
If Rng
is non-null, formats only that region.
Definition at line 511 of file ClangdServer.cpp.
References Action, clang::clangd::Changed, Code, clang::clangd::File, getDraft(), clang::clangd::getFormatStyleForFile(), clang::clangd::InvalidParams, and clang::clangd::positionToOffset().
void clang::clangd::ClangdServer::formatOnType | ( | PathRef | File, |
Position | Pos, | ||
StringRef | TriggerText, | ||
Callback< std::vector< TextEdit > > | CB | ||
) |
Run formatting after TriggerText
was typed at Pos
in File
with content Code
.
Definition at line 549 of file ClangdServer.cpp.
References Action, Code, clang::clangd::File, clang::clangd::formatIncremental(), getDraft(), clang::clangd::getFormatStyleForFile(), clang::clangd::InvalidParams, Pos, clang::clangd::positionToOffset(), and clang::clangd::replacementToEdit().
void clang::clangd::ClangdServer::getAST | ( | PathRef | File, |
std::optional< Range > | R, | ||
Callback< std::optional< ASTNode > > | CB | ||
) |
Describe the AST subtree for a piece of code.
Definition at line 1054 of file ClangdServer.cpp.
References Action, clang::clangd::SelectionTree::createEach(), clang::clangd::dumpAST(), Node, Offset, and clang::clangd::positionToOffset().
std::shared_ptr< const std::string > clang::clangd::ClangdServer::getDraft | ( | PathRef | File | ) | const |
Gets the contents of a currently tracked file.
Returns nullptr if the file isn't being tracked.
Definition at line 329 of file ClangdServer.cpp.
References clang::clangd::File, and clang::clangd::DraftStore::getDraft().
Referenced by foldingRanges(), formatFile(), and formatOnType().
void clang::clangd::ClangdServer::incomingCalls | ( | const CallHierarchyItem & | Item, |
Callback< std::vector< CallHierarchyIncomingCall > > | CB | ||
) |
Resolve incoming calls for a given call hierarchy item.
Definition at line 894 of file ClangdServer.cpp.
References clang::clangd::incomingCalls().
void clang::clangd::ClangdServer::inlayHints | ( | PathRef | File, |
std::optional< Range > | RestrictRange, | ||
Callback< std::vector< InlayHint > > | CB | ||
) |
Resolve inlay hints for a given document.
Definition at line 903 of file ClangdServer.cpp.
References Action, clang::clangd::File, and clang::clangd::inlayHints().
void clang::clangd::ClangdServer::locateSymbolAt | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< LocatedSymbol > > | CB | ||
) |
Find declaration/definition locations of symbol at a specified position.
Definition at line 785 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::locateSymbolAt(), and Pos.
void clang::clangd::ClangdServer::onFileEvent | ( | const DidChangeWatchedFilesParams & | Params | ) |
Called when an event occurs for a watched file in the workspace.
Definition at line 914 of file ClangdServer.cpp.
|
static |
Definition at line 195 of file ClangdServer.cpp.
References clang::clangd::DebouncePolicy::fixed().
void clang::clangd::ClangdServer::prepareCallHierarchy | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< CallHierarchyItem > > | CB | ||
) |
Get information about call hierarchy for a given position.
Definition at line 883 of file ClangdServer.cpp.
References Action, clang::clangd::File, Pos, and clang::clangd::prepareCallHierarchy().
void clang::clangd::ClangdServer::prepareRename | ( | PathRef | File, |
Position | Pos, | ||
std::optional< std::string > | NewName, | ||
const RenameOptions & | RenameOpts, | ||
Callback< RenameResult > | CB | ||
) |
Test the validity of a rename operation.
If NewName is provided, it performs a name validation.
Definition at line 572 of file ClangdServer.cpp.
References Action, clang::clangd::File, Pos, clang::clangd::rename(), and Results.
void clang::clangd::ClangdServer::profile | ( | MemoryTree & | MT | ) | const |
Builds a nested representation of memory used by components.
Definition at line 1159 of file ClangdServer.cpp.
References clang::clangd::MemoryTree::child().
void clang::clangd::ClangdServer::removeDocument | ( | PathRef | File | ) |
Remove File
from list of tracked files, schedule a request to free resources associated with it.
Pending diagnostics for closed files may not be delivered, even if requested with WantDiags::Auto or WantDiags::Yes. An empty set of diagnostics will be delivered, with Version = "".
Definition at line 413 of file ClangdServer.cpp.
References clang::clangd::File, and clang::clangd::DraftStore::removeDraft().
void clang::clangd::ClangdServer::rename | ( | PathRef | File, |
Position | Pos, | ||
llvm::StringRef | NewName, | ||
const RenameOptions & | Opts, | ||
Callback< RenameResult > | CB | ||
) |
Rename all occurrences of the symbol at the Pos
in File
to NewName
.
If WantFormat is false, the final TextEdit will be not formatted, embedders could use this method to get all occurrences of the symbol (e.g. highlighting them in prepare stage).
Definition at line 598 of file ClangdServer.cpp.
References Action, clang::clangd::trace::Metric::Distribution, E, clang::clangd::File, clang::clangd::getFormatStyleForFile(), Pos, clang::clangd::trace::Metric::record(), clang::clangd::reformatEdit(), and clang::clangd::rename().
void clang::clangd::ClangdServer::reparseOpenFilesIfNeeded | ( | llvm::function_ref< bool(llvm::StringRef File)> | Filter | ) |
Requests a reparse of currently opened files using their latest source.
This will typically only rebuild if something other than the source has changed (e.g. the CDB yields different flags, or files included in the preamble have been modified).
Definition at line 319 of file ClangdServer.cpp.
References addDocument(), clang::clangd::Auto, clang::clangd::DraftStore::getActiveFiles(), and clang::clangd::DraftStore::getDraft().
void clang::clangd::ClangdServer::resolveTypeHierarchy | ( | TypeHierarchyItem | Item, |
int | Resolve, | ||
TypeHierarchyDirection | Direction, | ||
Callback< std::optional< TypeHierarchyItem > > | CB | ||
) |
Resolve type hierarchy item in the given direction.
Definition at line 873 of file ClangdServer.cpp.
References clang::clangd::resolveTypeHierarchy().
void clang::clangd::ClangdServer::semanticHighlights | ( | PathRef | File, |
Callback< std::vector< HighlightingToken > > | CB | ||
) |
Definition at line 1037 of file ClangdServer.cpp.
References Action, clang::clangd::File, and clang::clangd::getSemanticHighlightings().
void clang::clangd::ClangdServer::semanticRanges | ( | PathRef | File, |
const std::vector< Position > & | Pos, | ||
Callback< std::vector< SelectionRange > > | CB | ||
) |
Get semantic ranges around a specified position in a file.
Definition at line 1006 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::getSemanticRanges(), and Pos.
void clang::clangd::ClangdServer::signatureHelp | ( | PathRef | File, |
Position | Pos, | ||
MarkupKind | DocumentationFormat, | ||
Callback< SignatureHelp > | CB | ||
) |
Provide signature help for File
at Pos
.
This method should only be called for tracked files.
Definition at line 482 of file ClangdServer.cpp.
References Action, clang::clangd::error(), clang::clangd::File, ParseInput, Pos, clang::clangd::PreambleData::Preamble, clang::clangd::signatureHelp(), and clang::clangd::TUScheduler::Stale.
void clang::clangd::ClangdServer::subTypes | ( | const TypeHierarchyItem & | Item, |
Callback< std::vector< TypeHierarchyItem > > | CB | ||
) |
Get direct children of a type hierarchy item.
Definition at line 866 of file ClangdServer.cpp.
References clang::clangd::subTypes().
void clang::clangd::ClangdServer::superTypes | ( | const TypeHierarchyItem & | Item, |
Callback< std::optional< std::vector< TypeHierarchyItem > > > | CB | ||
) |
Get direct parents of a type hierarchy item.
Definition at line 857 of file ClangdServer.cpp.
References clang::clangd::superTypes().
void clang::clangd::ClangdServer::switchSourceHeader | ( | PathRef | Path, |
Callback< std::optional< clangd::Path > > | CB | ||
) |
Switch to a corresponding source file when given a header file, and vice versa.
Definition at line 797 of file ClangdServer.cpp.
References Action, clang::clangd::getCorrespondingHeaderOrSource(), and clang::clangd::ThreadsafeFS::view().
void clang::clangd::ClangdServer::symbolInfo | ( | PathRef | File, |
Position | Pos, | ||
Callback< std::vector< SymbolDetails > > | CB | ||
) |
Get symbol info for given position.
Clangd extension - not part of official LSP.
Definition at line 994 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::getSymbolInfo(), and Pos.
void clang::clangd::ClangdServer::typeHierarchy | ( | PathRef | File, |
Position | Pos, | ||
int | Resolve, | ||
TypeHierarchyDirection | Direction, | ||
Callback< std::vector< TypeHierarchyItem > > | CB | ||
) |
Get information about type hierarchy for a given position.
Definition at line 843 of file ClangdServer.cpp.
References Action, clang::clangd::File, clang::clangd::getTypeHierarchy(), and Pos.
void clang::clangd::ClangdServer::workspaceSymbols | ( | StringRef | Query, |
int | Limit, | ||
Callback< std::vector< SymbolInformation > > | CB | ||
) |
Retrieve the top symbols from the workspace matching a query.
Definition at line 919 of file ClangdServer.cpp.