clang-tools
17.0.0git
|
Namespaces | |
config | |
detail | |
dex | |
markup | |
remote | |
riff | |
trace | |
Classes | |
struct | Anchor |
class | Annotations |
Same as llvm::Annotations, but adjusts functions to LSP-specific types for positions and ranges. More... | |
struct | ApplyWorkspaceEditParams |
struct | ApplyWorkspaceEditResponse |
class | ArgStripper |
struct | ASTAction |
struct | ASTNode |
Simplified description of a clang AST node. More... | |
struct | ASTParams |
Payload for textDocument/ast request. More... | |
struct | ASTRetentionPolicy |
Configuration of the AST retention policy. More... | |
struct | ASTSignals |
Signals derived from a valid AST of a file. More... | |
class | AsyncTaskRunner |
Runs tasks on separate (detached) threads and wait for all tasks to finish. More... | |
class | BackgroundIndex |
class | BackgroundIndexRebuilder |
class | BackgroundIndexRebuilderTest |
class | BackgroundIndexStorage |
class | BackgroundIndexTest |
class | BackgroundQueue |
struct | CallHierarchyIncomingCall |
Represents an incoming call, e.g. a caller of a method or constructor. More... | |
struct | CallHierarchyIncomingCallsParams |
The parameter of a callHierarchy/incomingCalls request. More... | |
struct | CallHierarchyItem |
Represents programming constructs like functions or constructors in the context of call hierarchy. More... | |
struct | CallHierarchyOutgoingCall |
Represents an outgoing call, e.g. More... | |
struct | CallHierarchyOutgoingCallsParams |
The parameter of a callHierarchy/outgoingCalls request. More... | |
struct | CallHierarchyPrepareParams |
The parameter of a textDocument/prepareCallHierarchy request. More... | |
class | CancelledError |
Conventional error when no result is returned due to cancellation. More... | |
struct | CancelState |
class | CanonicalIncludes |
Maps a definition location onto an #include file, based on a set of filename rules. More... | |
struct | CheapUnresolvedName |
struct | ClangdCompileCommand |
Clangd extension that's used in the 'compilationDatabaseChanges' in workspace/didChangeConfiguration to record updates to the in-memory compilation database. More... | |
struct | ClangdDiagnosticOptions |
class | ClangdLSPServer |
This class exposes ClangdServer's capabilities via Language Server Protocol. More... | |
class | ClangdServer |
Manages a collection of source files and derived data (ASTs, indexes), and provides language-aware features such as code completion. More... | |
struct | ClientCapabilities |
struct | CodeAction |
A code action represents a change that can be performed in code, e.g. More... | |
struct | CodeActionContext |
struct | CodeActionParams |
struct | CodeCompleteOptions |
struct | CodeCompleteResult |
struct | CodeCompletion |
struct | CodeDescription |
Structure to capture a description for an error code. More... | |
class | CollectMainFileMacros |
Collects macro references (e.g. More... | |
class | CollectPragmaMarks |
struct | Command |
struct | CommandMangler |
struct | CompletionContext |
struct | CompletionItem |
struct | CompletionList |
Represents a collection of completion items to be presented in the editor. More... | |
struct | CompletionParams |
struct | CompletionPrefix |
struct | Config |
Settings that express user/project preferences and control clangd behavior. More... | |
struct | ConfigurationSettings |
Clangd extension: parameters configurable at any time, via the workspace/didChangeConfiguration notification. More... | |
class | Context |
A context is an immutable container for per-request data that must be propagated through layers that don't care about it. More... | |
class | Deadline |
A point in time we can wait for. More... | |
struct | DebouncePolicy |
Clangd may wait after an update to see if another one comes along. More... | |
struct | DecisionForestScores |
Same semantics as CodeComplete::Score. More... | |
class | DeclRelationSet |
struct | DefinedMacro |
class | DelegatingCDB |
struct | Diag |
A top-level diagnostic that may have Notes and Fixes. More... | |
struct | DiagBase |
Contains basic information about a diagnostic. More... | |
struct | Diagnostic |
struct | DiagnosticRelatedInformation |
Represents a related message and source code location for a diagnostic. More... | |
struct | DidChangeConfigurationParams |
struct | DidChangeTextDocumentParams |
struct | DidChangeWatchedFilesParams |
struct | DidCloseTextDocumentParams |
struct | DidOpenTextDocumentParams |
struct | DidSaveTextDocumentParams |
class | DirectoryBasedGlobalCompilationDatabase |
Gets compile args from tooling::CompilationDatabases built for parent directories. More... | |
class | DirectoryBasedGlobalCompilationDatabaseCacheTest |
struct | DocumentFormattingParams |
struct | DocumentHighlight |
A document highlight is a range inside a text document which deserves special attention. More... | |
struct | DocumentLink |
A range in a text document that links to an internal or external resource, like another text document or a web site. More... | |
struct | DocumentLinkParams |
Parameters for the document link request. More... | |
struct | DocumentOnTypeFormattingParams |
struct | DocumentRangeFormattingParams |
struct | DocumentSymbol |
Represents programming constructs like variables, classes, interfaces etc. More... | |
struct | DocumentSymbolParams |
class | DraftStore |
A thread-safe container for files opened in a workspace, addressed by filenames. More... | |
struct | Edit |
A set of edits generated for a single file. More... | |
struct | EligibleRegion |
Represents locations that can accept a definition. More... | |
class | Event |
An Event<T> allows events of type T to be broadcast to listeners. More... | |
struct | ExecuteCommandParams |
class | FeatureModule |
A FeatureModule contributes a vertical feature to clangd. More... | |
class | FeatureModuleSet |
A FeatureModuleSet is a collection of feature modules installed in clangd. More... | |
class | FileCache |
Base class for threadsafe cache of data read from a file on disk. More... | |
class | FileDistance |
struct | FileDistanceOptions |
struct | FileEvent |
class | FileIndex |
This manages symbols from files and an in-memory index on all symbols. More... | |
struct | FileShardedIndex |
Takes slabs coming from a TU (multiple files) and shards them per declaration location. More... | |
struct | FileStatus |
Clangd extension: indicates the current state of the file in clangd, sent from server via the textDocument/clangd.fileStatus notification. More... | |
class | FileSymbols |
A container of slabs associated with a key. More... | |
struct | Fix |
Represents a single fix-it that editor can apply to fix the error. More... | |
struct | FoldingRange |
Stores information about a region of code that can be folded. More... | |
struct | FoldingRangeParams |
struct | FuzzyFindRequest |
class | FuzzyMatcher |
class | GlobalCompilationDatabase |
Provides compilation arguments used for parsing C and C++ files. More... | |
struct | HeaderFile |
Represents a header file to be #include'd. More... | |
class | HeuristicResolver |
struct | HighlightingToken |
struct | Hover |
struct | HoverInfo |
Contains detailed information about a Symbol. More... | |
class | IgnoreDiagnostics |
class | IncludeFixer |
Attempts to recover from error diagnostics by suggesting include insertion fixes. More... | |
struct | IncludeGraphNode |
class | IncludeInserter |
class | IncludeStructure |
struct | Inclusion |
struct | IndexFileIn |
struct | IndexFileOut |
struct | InitializationOptions |
Clangd extension: parameters configurable at initialize time. More... | |
struct | InitializeParams |
struct | InlayHint |
Inlay hint information. More... | |
struct | InlayHintsParams |
A parameter literal used in inlay hint requests. More... | |
struct | InputsAndAST |
struct | InputsAndPreamble |
class | Key |
Values in a Context are indexed by typed keys. More... | |
struct | LoadedShard |
Represents a shard loaded from storage, stores contents in Shard and metadata about the source file that generated this shard. More... | |
struct | LocatedSymbol |
struct | Location |
class | Logger |
Interface to allow custom logging in clangd. More... | |
class | LoggingSession |
Only one LoggingSession can be active at a time. More... | |
struct | LookupRequest |
class | LSPBinder |
LSPBinder collects a table of functions that handle LSP calls. More... | |
class | LSPClient |
struct | LSPDiagnosticCompare |
A LSP-specific comparator used to find diagnostic in a container like std:map. More... | |
class | LSPError |
struct | MacroOccurrence |
struct | MainFileMacros |
struct | MarkupContent |
class | MemIndex |
MemIndex is a naive in-memory index suitable for a small set of symbols. More... | |
class | Memoize |
Memoize is a cache to store and reuse computation results based on a key. More... | |
class | MemoryShardStorage |
struct | MemoryTree |
A tree that can be used to represent memory usage of nested components while preserving the hierarchy. More... | |
class | MergedIndex |
class | MockCompilationDatabase |
class | MockFS |
struct | NoParams |
struct | Note |
Represents a note for the diagnostic. More... | |
class | Notification |
A threadsafe flag that is initially clear. More... | |
class | OpaqueType |
A representation of a type that can be computed based on clang AST and compared for equality. More... | |
class | OptionalMatcher |
class | OverlayCDB |
Wraps another compilation database, and supports overriding the commands using an in-memory mapping. More... | |
struct | ParameterInformation |
A single parameter of a particular signature. More... | |
class | ParsedAST |
Stores and provides access to parsed AST. More... | |
struct | ParseInputs |
Information required to run clang, e.g. to parse AST or do code completion. More... | |
struct | ParseOptions |
class | ParsingCallbacks |
struct | PathMapping |
PathMappings are a collection of paired client and server paths. More... | |
class | PeriodicThrottler |
Used to guard an operation that should run at most every N seconds. More... | |
class | PolySubsequenceMatcher |
struct | Position |
struct | PragmaMark |
Represents a #pragma mark in the main file. More... | |
struct | PreambleBuildStats |
Timings and statistics from the premble build. More... | |
struct | PreambleData |
The parsed preamble and associated data. More... | |
class | PreambleFileStatusCache |
Records status information for files open()ed or stat()ed during preamble build (except for the main file), so we can avoid stat()s on the underlying FS when reusing the preamble. More... | |
class | PreamblePatch |
Stores information required to parse a TU using a (possibly stale) Baseline preamble. More... | |
class | PreambleThrottler |
PreambleThrottler controls which preambles can build at any given time. More... | |
struct | ProgressParams |
struct | ProjectInfo |
struct | PublishDiagnosticsParams |
struct | Range |
class | RealThreadsafeFS |
struct | Ref |
Represents a symbol occurrence in the source file. More... | |
struct | ReferenceContext |
struct | ReferencedFiles |
struct | ReferencedLocations |
struct | ReferenceLoc |
Information about a reference written in the source code, independent of the actual AST node that this reference lives in. More... | |
struct | ReferenceLocation |
Extends Locations returned by textDocument/references with extra info. More... | |
struct | ReferenceParams |
struct | ReferencesResult |
class | RefSlab |
An efficient structure of storing large set of symbol references in memory. More... | |
struct | RefsRequest |
struct | Relation |
Represents a relation between two symbols. More... | |
class | RelationSlab |
struct | RelationsRequest |
struct | RenameInputs |
struct | RenameOptions |
struct | RenameParams |
struct | RenameResult |
struct | ResolveTypeHierarchyItemParams |
Parameters for the typeHierarchy/resolve request. More... | |
class | ScopeDistance |
Support lookups like FileDistance, but the lookup keys are symbol scopes. More... | |
struct | SelectionRange |
struct | SelectionRangeParams |
class | SelectionTree |
struct | SemanticToken |
Specifies a single semantic token in the document. More... | |
struct | SemanticTokens |
A versioned set of tokens. More... | |
struct | SemanticTokensDeltaParams |
Body of textDocument/semanticTokens/full/delta request. More... | |
struct | SemanticTokensEdit |
Describes a replacement of a contiguous range of semanticTokens. More... | |
struct | SemanticTokensOrDelta |
This models LSP SemanticTokensDelta | SemanticTokens, which is the result of textDocument/semanticTokens/full/delta. More... | |
struct | SemanticTokensParams |
Body of textDocument/semanticTokens/full request. More... | |
class | Semaphore |
Limits the number of threads that can acquire the lock at the same time. More... | |
struct | ShowMessageParams |
The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface. More... | |
struct | SignatureHelp |
Represents the signature of a callable. More... | |
struct | SignatureInformation |
Represents the signature of something callable. More... | |
struct | SignatureQualitySignals |
struct | SourceParams |
struct | SpeculativeFuzzyFind |
A speculative and asynchronous fuzzy find index request (based on cached request) that can be sent before parsing sema. More... | |
struct | SpelledWord |
struct | StdLibLocation |
class | StdLibSet |
class | StoreDiags |
StoreDiags collects the diagnostics that can later be reported by clangd. More... | |
class | StreamLogger |
class | SubsequenceMatcher |
class | SwapIndex |
struct | Symbol |
The class presents a C++ symbol, e.g. More... | |
class | SymbolCollector |
Collect declarations (symbols) from an AST. More... | |
struct | SymbolDetails |
Represents information about identifier. More... | |
class | SymbolID |
struct | SymbolInclude |
A header and directives as stored in a Symbol. More... | |
class | SymbolIndex |
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbols based on names or unique IDs. More... | |
struct | SymbolInformation |
Represents information about programming constructs like variables, classes, interfaces etc. More... | |
struct | SymbolLocation |
struct | SymbolQualitySignals |
Attributes of a symbol that affect how much we like it. More... | |
struct | SymbolRelevanceSignals |
Attributes of a symbol-query pair that affect how much we like it. More... | |
class | SymbolSlab |
An immutable symbol container that stores a set of symbols. More... | |
class | TestScheme |
unittest: is a scheme that refers to files relative to testRoot(). More... | |
struct | TestTU |
class | TestWorkspace |
struct | TextDocumentContentChangeEvent |
struct | TextDocumentIdentifier |
struct | TextDocumentItem |
struct | TextDocumentPositionParams |
struct | TextEdit |
class | ThreadCrashReporter |
Allows setting per-thread abort/kill signal callbacks, to print additional information about the crash depending on which thread got signalled. More... | |
class | ThreadingTest |
class | ThreadsafeFS |
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd. More... | |
class | TopN |
TopN<T> is a lossy container that preserves only the "best" N elements. More... | |
class | Transport |
class | TraverseHeadersToo |
class | TUScheduler |
Handles running tasks for ClangdServer and managing the resources (e.g., preambles and ASTs) for opened files. More... | |
struct | TUStatus |
class | Tweak |
An interface base for small context-sensitive refactoring actions. More... | |
struct | TweakArgs |
Arguments for the 'applyTweak' command. More... | |
class | TweakTest |
struct | TypeHierarchyItem |
struct | TypeHierarchyPrepareParams |
The type hierarchy params is an extension of the TextDocumentPositionsParams with optional properties which can be used to eagerly resolve the item when requesting from the server. More... | |
class | URI |
A URI describes the location of a source file. More... | |
class | URIDistance |
struct | URIForFile |
class | URIScheme |
URIScheme is an extension point for teaching clangd to recognize a custom URI scheme. More... | |
struct | VersionedTextDocumentIdentifier |
class | WithContext |
WithContext replaces Context::current() with a provided scope. More... | |
class | WithContextValue |
WithContextValue extends Context::current() with a single value. More... | |
struct | WorkDoneProgressBegin |
To start progress reporting a $/progress notification with the following payload must be sent. More... | |
struct | WorkDoneProgressCreateParams |
struct | WorkDoneProgressEnd |
Signals the end of progress reporting. More... | |
struct | WorkDoneProgressReport |
Reporting progress is done using the following payload. More... | |
struct | WorkspaceEdit |
struct | WorkspaceSymbolParams |
The parameters of a Workspace Symbol Request. More... | |
Typedefs | |
using | CharTypeSet = unsigned char |
using | SystemIncludeExtractorFn = llvm::unique_function< void(tooling::CompileCommand &, llvm::StringRef) const > |
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags. More... | |
using | IncludeGraph = llvm::StringMap< IncludeGraphNode > |
using | SlabTuple = std::tuple< SymbolSlab, RefSlab, RelationSlab > |
using | IndexFactory = std::function< std::unique_ptr< SymbolIndex >(const Config::ExternalIndexSpec &, AsyncTaskRunner *)> |
A functor to create an index for an external index specification. More... | |
using | PathMappings = std::vector< PathMapping > |
using | PreambleParsedCallback = std::function< void(ASTContext &, Preprocessor &, const CanonicalIncludes &)> |
using | InitializedParams = NoParams |
using | CompletionItemKindBitset = std::bitset< CompletionItemKindMax+1 > |
using | SymbolKindBitset = std::bitset< SymbolKindMax+1 > |
typedef llvm::Registry< Tweak > | TweakRegistry |
A handy typedef to save some typing. More... | |
using | FileDigest = std::array< uint8_t, 8 > |
using | FileEdits = llvm::StringMap< Edit > |
A mapping from absolute file path (the one used for accessing the underlying VFS) to edits. More... | |
using | Canceler = std::function< void()> |
A canceller requests cancellation of a task, when called. More... | |
template<typename T > | |
using | Callback = llvm::unique_function< void(llvm::Expected< T >)> |
A Callback<T> is a void function that accepts Expected<T>. More... | |
using | Path = std::string |
A typedef to represent a file path. More... | |
using | PathRef = llvm::StringRef |
A typedef to represent a ref to file path. More... | |
using | TidyProvider = llvm::unique_function< void(tidy::ClangTidyOptions &, llvm::StringRef) const > |
A factory to modify a tidy::ClangTidyOptions. More... | |
using | TidyProviderRef = llvm::function_ref< void(tidy::ClangTidyOptions &, llvm::StringRef)> |
A factory to modify a tidy::ClangTidyOptions that doesn't hold any state. More... | |
using | Obj = llvm::json::Object |
typedef llvm::Registry< URIScheme > | URISchemeRegistry |
By default, a "file" scheme is supported where URI paths are always absolute in the file system. More... | |
using | RecursionProtectionSet = llvm::SmallSet< const CXXRecordDecl *, 4 > |
Functions | |
bool | isImplicitTemplateInstantiation (const NamedDecl *D) |
Indicates if D is a template instantiation implicitly generated by the compiler, e.g. More... | |
bool | isExplicitTemplateSpecialization (const NamedDecl *D) |
Indicates if D is an explicit template specialization, e.g. More... | |
bool | isImplementationDetail (const Decl *D) |
Returns true if the declaration is considered implementation detail based on heuristics. More... | |
SourceLocation | nameLocation (const clang::Decl &D, const SourceManager &SM) |
Find the source location of the identifier for D . More... | |
std::string | printQualifiedName (const NamedDecl &ND) |
Returns the qualified name of ND. More... | |
static bool | isAnonymous (const DeclarationName &N) |
NestedNameSpecifierLoc | getQualifierLoc (const NamedDecl &ND) |
Returns a nested name specifier loc of ND if it was present in the source, e.g. More... | |
std::string | printUsingNamespaceName (const ASTContext &Ctx, const UsingDirectiveDecl &D) |
Returns the name of the namespace inside the 'using namespace' directive, as written in the code. More... | |
std::string | printName (const ASTContext &Ctx, const NamedDecl &ND) |
Prints unqualified name of the decl for the purpose of displaying it to the user. More... | |
std::string | printTemplateSpecializationArgs (const NamedDecl &ND) |
Prints template arguments of a decl as written in the source code, including enclosing '<' and '>', e.g for a partial specialization like: template <typename U> struct Foo<int, U> will return '<int, U>'. More... | |
std::string | printNamespaceScope (const DeclContext &DC) |
Returns the first enclosing namespace scope starting from DC . More... | |
static llvm::StringRef | getNameOrErrForObjCInterface (const ObjCInterfaceDecl *ID) |
std::string | printObjCMethod (const ObjCMethodDecl &Method) |
Print the Objective-C method name, including the full container name, e.g. More... | |
std::string | printObjCContainer (const ObjCContainerDecl &C) |
Print the Objective-C container name including categories, e.g. MyClass ,. More... | |
SymbolID | getSymbolID (const Decl *D) |
Gets the symbol ID for a declaration. Returned SymbolID might be null. More... | |
SymbolID | getSymbolID (const llvm::StringRef MacroName, const MacroInfo *MI, const SourceManager &SM) |
Gets the symbol ID for a macro. More... | |
const ObjCImplDecl * | getCorrespondingObjCImpl (const ObjCContainerDecl *D) |
Return the corresponding implementation/definition for the given ObjC container if it has one, otherwise, return nullptr. More... | |
Symbol::IncludeDirective | preferredIncludeDirective (llvm::StringRef FileName, const LangOptions &LangOpts, ArrayRef< Inclusion > MainFileIncludes, ArrayRef< const Decl * > TopLevelDecls) |
Infer the include directive to use for the given FileName . More... | |
std::string | printType (const QualType QT, const DeclContext &CurContext, llvm::StringRef Placeholder="") |
Returns a QualType as string. More... | |
bool | hasReservedName (const Decl &) |
Returns true if this is a NamedDecl with a reserved name. More... | |
bool | hasReservedScope (const DeclContext &) |
Returns true if this scope would be written with a reserved name. More... | |
QualType | declaredType (const TypeDecl *D) |
std::optional< QualType > | getDeducedType (ASTContext &, SourceLocation Loc) |
Retrieves the deduced type at a given location (auto, decltype). More... | |
TemplateTypeParmTypeLoc | getContainedAutoParamType (TypeLoc TL) |
template<typename TemplateDeclTy > | |
static NamedDecl * | getOnlyInstantiationImpl (TemplateDeclTy *TD) |
NamedDecl * | getOnlyInstantiation (NamedDecl *TemplatedDecl) |
std::vector< const Attr * > | getAttributes (const DynTypedNode &) |
Return attributes attached directly to a node. More... | |
std::string | getQualification (ASTContext &Context, const DeclContext *DestContext, SourceLocation InsertionPoint, const NamedDecl *ND) |
Gets the nested name specifier necessary for spelling ND in DestContext , at InsertionPoint . More... | |
std::string | getQualification (ASTContext &Context, const DeclContext *DestContext, const NamedDecl *ND, llvm::ArrayRef< std::string > VisibleNamespaces) |
This function uses the VisibleNamespaces to figure out if a shorter qualification is sufficient for ND , and ignores any using namespace directives. More... | |
bool | hasUnstableLinkage (const Decl *D) |
Whether we must avoid computing linkage for D during code completion. More... | |
bool | isDeeplyNested (const Decl *D, unsigned MaxDepth=10) |
Checks whether D is more than MaxDepth away from translation unit scope. More... | |
SmallVector< const ParmVarDecl * > | resolveForwardingParameters (const FunctionDecl *D, unsigned MaxDepth=10) |
Recursively resolves the parameters of a FunctionDecl that forwards its parameters to another function via variadic template parameters. More... | |
bool | isExpandedFromParameterPack (const ParmVarDecl *D) |
Checks whether D is instantiated from a function parameter pack whose type is a bare type parameter pack (e.g. More... | |
static std::vector< llvm::StringRef > | semanticTokenTypes () |
static std::vector< llvm::StringRef > | semanticTokenModifiers () |
static std::vector< SymbolInformation > | flattenSymbolHierarchy (llvm::ArrayRef< DocumentSymbol > Symbols, const URIForFile &FileURI) |
The functions constructs a flattened view of the DocumentSymbol hierarchy. More... | |
static std::optional< Command > | asCommand (const CodeAction &Action) |
static Location * | getToggle (const TextDocumentPositionParams &Point, LocatedSymbol &Sym) |
llvm::json::Value | serializeTHIForExtension (TypeHierarchyItem THI) |
static void | increment (std::string &S) |
static llvm::Expected< std::vector< std::unique_ptr< Tweak::Selection > > > | tweakSelection (const Range &Sel, const InputsAndAST &AST, llvm::vfs::FileSystem *FS) |
CompletionPrefix | guessCompletionPrefix (llvm::StringRef Content, unsigned Offset) |
CodeCompleteResult | codeCompleteComment (PathRef FileName, unsigned Offset, llvm::StringRef Prefix, const PreambleData *Preamble, const ParseInputs &ParseInput) |
std::optional< unsigned > | maybeFunctionArgumentCommentStart (llvm::StringRef Content) |
CodeCompleteResult | codeComplete (PathRef FileName, Position Pos, const PreambleData *Preamble, const ParseInputs &ParseInput, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind=nullptr) |
Gets code completions at a specified Pos in FileName . More... | |
SignatureHelp | signatureHelp (PathRef FileName, Position Pos, const PreambleData &Preamble, const ParseInputs &ParseInput, MarkupKind DocumentationFormat) |
Get signature help at a specified Pos in FileName . More... | |
bool | isIndexedForCodeCompletion (const NamedDecl &ND, ASTContext &ASTCtx) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const CodeCompletion &C) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const CodeCompleteResult &R) |
bool | isIncludeFile (llvm::StringRef Line) |
bool | allowImplicitCompletion (llvm::StringRef Content, unsigned Offset) |
raw_ostream & | operator<< (raw_ostream &, const CodeCompletion &) |
raw_ostream & | operator<< (raw_ostream &, const CodeCompleteResult &) |
std::string | getDocComment (const ASTContext &Ctx, const CodeCompletionResult &Result, bool CommentsFromHeaders) |
Gets a minimally formatted documentation comment of Result , with comment markers stripped. More... | |
std::string | getDeclComment (const ASTContext &Ctx, const NamedDecl &D) |
Similar to getDocComment, but returns the comment for a NamedDecl. More... | |
void | getSignature (const CodeCompletionString &CCS, std::string *Signature, std::string *Snippet, std::string *RequiredQualifiers=nullptr, bool CompletingPattern=false) |
Formats the signature for an item, as a display string and snippet. More... | |
std::string | formatDocumentation (const CodeCompletionString &CCS, llvm::StringRef DocComment) |
Assembles formatted documentation for a completion result. More... | |
std::string | getReturnType (const CodeCompletionString &CCS) |
Gets detail to be used as the detail field in an LSP completion item. More... | |
std::unique_ptr< PPCallbacks > | collectPragmaMarksCallback (const SourceManager &, std::vector< PragmaMark > &Out) |
Collect all pragma marks from the main file. More... | |
std::string | printArgv (llvm::ArrayRef< llvm::StringRef > Args) |
std::string | printArgv (llvm::ArrayRef< std::string > Args) |
void | allowCrashPragmasForTest () |
Respect #pragma clang __debug crash etc, which are usually disabled. More... | |
void | disableUnsupportedOptions (CompilerInvocation &CI) |
Clears CI from options that are not supported by clangd, like codegen or plugins. More... | |
std::unique_ptr< CompilerInvocation > | buildCompilerInvocation (const ParseInputs &Inputs, clang::DiagnosticConsumer &D, std::vector< std::string > *CC1Args=nullptr) |
Builds compiler invocation that could be used to build AST or preamble. More... | |
std::unique_ptr< CompilerInstance > | prepareCompilerInstance (std::unique_ptr< clang::CompilerInvocation > CI, const PrecompiledPreamble *Preamble, std::unique_ptr< llvm::MemoryBuffer > Buffer, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, DiagnosticConsumer &DiagsClient) |
std::unique_ptr< CompilerInstance > | prepareCompilerInstance (std::unique_ptr< clang::CompilerInvocation >, const PrecompiledPreamble *, std::unique_ptr< llvm::MemoryBuffer > MainFile, IntrusiveRefCntPtr< llvm::vfs::FileSystem >, DiagnosticConsumer &) |
Creates a compiler instance, configured so that: More... | |
DecisionForestScores | evaluateDecisionForest (const SymbolQualitySignals &Quality, const SymbolRelevanceSignals &Relevance, float Base) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const DiagBase &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Fix &F) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diag &D) |
CodeAction | toCodeAction (const Fix &D, const URIForFile &File) |
Convert from Fix to LSP CodeAction. More... | |
Diag | toDiag (const llvm::SMDiagnostic &D, Diag::DiagSource Source) |
void | toLSPDiags (const Diag &D, const URIForFile &File, const ClangdDiagnosticOptions &Opts, llvm::function_ref< void(clangd::Diagnostic, llvm::ArrayRef< Fix >)> OutFn) |
Conversion to LSP diagnostics. More... | |
int | getSeverity (DiagnosticsEngine::Level L) |
Convert from clang diagnostic level to LSP severity. More... | |
static void | writeCodeToFixMessage (llvm::raw_ostream &OS, llvm::StringRef Code) |
Sanitizes a piece for presenting it in a synthesized fix message. More... | |
static void | fillNonLocationData (DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &Info, clangd::DiagBase &D) |
Fills D with all information, except the location-related bits. More... | |
bool | isBuiltinDiagnosticSuppressed (unsigned ID, const llvm::StringSet<> &Suppressed, const LangOptions &) |
Determine whether a (non-clang-tidy) diagnostic is suppressed by config. More... | |
llvm::StringRef | normalizeSuppressedCode (llvm::StringRef) |
Take a user-specified diagnostic code, and convert it to a normalized form stored in the config and consumed by isBuiltinDiagnosticsSuppressed. More... | |
std::optional< std::string > | getDiagnosticDocURI (Diag::DiagSource, unsigned ID, llvm::StringRef Name) |
Returns a URI providing more information about a particular diagnostic. More... | |
static void | increment (std::string &S) |
static void | updateVersion (DraftStore::Draft &D, llvm::StringRef SpecifiedVersion) |
ASTNode | dumpAST (const DynTypedNode &N, const syntax::TokenBuffer &Tokens, const ASTContext &Ctx) |
std::string | versionString () |
std::string | platformString () |
std::string | featureString () |
static llvm::SmallString< 128 > | canonicalize (llvm::StringRef Path) |
static std::pair< std::string, int > | scopeToPath (llvm::StringRef Scope) |
static FileDistance | createScopeFileDistance (llvm::ArrayRef< std::string > QueryScopes) |
llvm::Expected< Location > | indexToLSPLocation (const SymbolLocation &Loc, llvm::StringRef TUPath) |
Helper function for deriving an LSP Location from an index SymbolLocation. More... | |
llvm::Expected< Location > | symbolToLocation (const Symbol &Sym, llvm::StringRef TUPath) |
Helper function for deriving an LSP Location for a Symbol. More... | |
llvm::Expected< std::vector< SymbolInformation > > | getWorkspaceSymbols (llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath) |
Searches for the symbols matching Query . More... | |
llvm::Expected< std::vector< DocumentSymbol > > | getDocumentSymbols (ParsedAST &AST) |
Retrieves the symbols contained in the "main file" section of an AST in the same order that they appear. More... | |
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > | allTargetDecls (const DynTypedNode &, const HeuristicResolver *) |
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along with their DeclRelationSets. More... | |
llvm::SmallVector< const NamedDecl *, 1 > | targetDecl (const DynTypedNode &, DeclRelationSet Mask, const HeuristicResolver *Resolver) |
targetDecl() finds the declaration referred to by an AST node. More... | |
llvm::SmallVector< const NamedDecl *, 1 > | explicitReferenceTargets (DynTypedNode N, DeclRelationSet Mask, const HeuristicResolver *Resolver) |
Find declarations explicitly referenced in the source code defined by N . More... | |
void | findExplicitReferences (const Stmt *S, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
Recursively traverse S and report all references explicitly written in the code. More... | |
void | findExplicitReferences (const Decl *D, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
void | findExplicitReferences (const ASTContext &AST, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, DeclRelation R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, DeclRelationSet RS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, ReferenceLoc R) |
DeclRelationSet | operator| (DeclRelation L, DeclRelation R) |
DeclRelationSet | operator& (DeclRelation L, DeclRelation R) |
DeclRelationSet | operator~ (DeclRelation R) |
std::vector< tooling::Replacement > | formatIncremental (llvm::StringRef Code, unsigned Cursor, llvm::StringRef InsertedText, format::FormatStyle Style) |
Applies limited formatting around new InsertedText . More... | |
unsigned | transformCursorPosition (unsigned Offset, const std::vector< tooling::Replacement > &Replacements) |
Determine the new cursor position after applying Replacements . More... | |
Path | removeDots (PathRef File) |
Returns a version of File that doesn't contain dots and dot dots. More... | |
static char | lower (char C) |
static bool | isAwful (int S) |
template<typename T > | |
static T | packedLookup (const uint8_t *Data, int I) |
CharTypeSet | calculateRoles (llvm::StringRef Text, llvm::MutableArrayRef< CharRole > Roles) |
static std::unique_ptr< tooling::CompilationDatabase > | parseJSON (PathRef Path, llvm::StringRef Data, std::string &Error) |
static std::unique_ptr< tooling::CompilationDatabase > | parseFixed (PathRef Path, llvm::StringRef Data, std::string &Error) |
SystemIncludeExtractorFn | getSystemIncludeExtractor (llvm::ArrayRef< std::string > QueryDriverGlobs) |
bool | isLiteralInclude (llvm::StringRef Include) |
Returns true if Include is literal include like "path" or <path>. More... | |
llvm::Expected< HeaderFile > | toHeaderFile (llvm::StringRef Header, llvm::StringRef HintPath) |
Creates a HeaderFile from Header which can be either a URI or a literal include. More... | |
llvm::SmallVector< SymbolInclude, 1 > | getRankedIncludes (const Symbol &Sym) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Inclusion &Inc) |
bool | operator== (const Inclusion &LHS, const Inclusion &RHS) |
IncludeGraphNode::SourceFlag | operator| (IncludeGraphNode::SourceFlag A, IncludeGraphNode::SourceFlag B) |
bool | operator& (IncludeGraphNode::SourceFlag A, IncludeGraphNode::SourceFlag B) |
IncludeGraphNode::SourceFlag & | operator|= (IncludeGraphNode::SourceFlag &A, IncludeGraphNode::SourceFlag B) |
std::optional< Path > | getCorrespondingHeaderOrSource (PathRef OriginalFile, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS) |
Given a header file, returns the best matching source file, and vice visa. More... | |
std::optional< Path > | getCorrespondingHeaderOrSource (PathRef OriginalFile, ParsedAST &AST, const SymbolIndex *Index) |
Given a header file, returns the best matching source file, and vice visa. More... | |
std::vector< const Decl * > | getIndexableLocalDecls (ParsedAST &AST) |
Returns all indexable decls that are present in the main file of the AST. More... | |
CXXRecordDecl * | resolveTypeToRecordDecl (const Type *T) |
const Type * | resolveDeclsToType (const std::vector< const NamedDecl * > &Decls) |
std::optional< HoverInfo > | getHover (ParsedAST &AST, Position Pos, const format::FormatStyle &Style, const SymbolIndex *Index) |
Get the hover information when hovering at Pos . More... | |
std::optional< llvm::StringRef > | getBacktickQuoteRange (llvm::StringRef Line, unsigned Offset) |
void | parseDocumentationLine (llvm::StringRef Line, markup::Paragraph &Out) |
void | parseDocumentation (llvm::StringRef Input, markup::Document &Output) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const HoverInfo::PrintedType &T) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const HoverInfo::Param &P) |
bool | operator== (const HoverInfo::PrintedType &LHS, const HoverInfo::PrintedType &RHS) |
bool | operator== (const HoverInfo::PassType &LHS, const HoverInfo::PassType &RHS) |
bool | operator== (const HoverInfo::Param &LHS, const HoverInfo::Param &RHS) |
void | setIncludeCleanerAnalyzesStdlib (bool B) |
Affects whether standard library includes should be considered for removal. More... | |
ReferencedLocations | findReferencedLocations (ASTContext &Ctx, Preprocessor &PP, const syntax::TokenBuffer *Tokens) |
Finds locations of all symbols used in the main file. More... | |
ReferencedLocations | findReferencedLocations (ParsedAST &AST) |
ReferencedFiles | findReferencedFiles (const ReferencedLocations &Locs, const SourceManager &SM, llvm::function_ref< FileID(FileID)> HeaderResponsible, llvm::function_ref< std::optional< StringRef >(FileID)> UmbrellaHeader) |
Retrieves IDs of all files containing SourceLocations from Locs . More... | |
ReferencedFiles | findReferencedFiles (const ReferencedLocations &Locs, const IncludeStructure &Includes, const CanonicalIncludes &CanonIncludes, const SourceManager &SM) |
std::vector< const Inclusion * > | getUnused (ParsedAST &AST, const llvm::DenseSet< IncludeStructure::HeaderID > &ReferencedFiles, const llvm::StringSet<> &ReferencedPublicHeaders) |
Retrieves headers that are referenced from the main file but not used. More... | |
static bool | isSpecialBuffer (FileID FID, const SourceManager &SM) |
llvm::DenseSet< IncludeStructure::HeaderID > | translateToHeaderIDs (const ReferencedFiles &Files, const IncludeStructure &Includes, const SourceManager &SM) |
Maps FileIDs to the internal IncludeStructure representation (HeaderIDs). More... | |
std::vector< const Inclusion * > | computeUnusedIncludes (ParsedAST &AST) |
std::vector< const Inclusion * > | computeUnusedIncludesExperimental (ParsedAST &AST) |
std::vector< Diag > | issueUnusedIncludesDiagnostics (ParsedAST &AST, llvm::StringRef Code) |
std::optional< std::string > | qualifiedByUnresolved (const SourceManager &SM, SourceLocation Loc, const LangOptions &LangOpts) |
std::optional< std::string > | getSpelledSpecifier (const CXXScopeSpec &SS, const SourceManager &SM) |
std::optional< CheapUnresolvedName > | extractUnresolvedNameCheaply (const SourceManager &SM, const DeclarationNameInfo &Unresolved, CXXScopeSpec *SS, const LangOptions &LangOpts, bool UnresolvedIsSpecifier) |
std::vector< std::string > | collectAccessibleScopes (Sema &Sem, const DeclarationNameInfo &Typo, Scope *S, Sema::LookupNameKind LookupKind) |
Returns all namespace scopes that the unqualified lookup would visit. More... | |
static llvm::StringRef | filenameWithoutExtension (llvm::StringRef Path) |
std::vector< LoadedShard > | loadIndexShards (llvm::ArrayRef< Path > MainFiles, BackgroundIndexStorage::Factory &IndexStorageFactory, const GlobalCompilationDatabase &CDB) |
Loads all shards for the TU MainFile from Storage . More... | |
std::unique_ptr< CommentHandler > | collectIWYUHeaderMaps (CanonicalIncludes *Includes) |
Returns a CommentHandler that parses pragma comment on include files to determine when we should include a different header from the header that directly defines a symbol. More... | |
SlabTuple | indexMainDecls (ParsedAST &AST) |
Retrieves symbols and refs of local top level decls in AST (i.e. More... | |
SlabTuple | indexHeaderSymbols (llvm::StringRef Version, ASTContext &AST, Preprocessor &PP, const CanonicalIncludes &Includes) |
Index declarations from AST and macros from PP that are declared in included headers. More... | |
bool | fromJSON (const llvm::json::Value &Parameters, FuzzyFindRequest &Request, llvm::json::Path P) |
llvm::json::Value | toJSON (const FuzzyFindRequest &Request) |
constexpr IndexContents | operator& (IndexContents L, IndexContents R) |
constexpr IndexContents | operator| (IndexContents L, IndexContents R) |
std::unique_ptr< FrontendAction > | createStaticIndexingAction (SymbolCollector::Options Opts, std::function< void(SymbolSlab)> SymbolsCallback, std::function< void(RefSlab)> RefsCallback, std::function< void(RelationSlab)> RelationsCallback, std::function< void(IncludeGraph)> IncludeGraphCallback) |
static bool | prefer (const SymbolLocation &L, const SymbolLocation &R) |
Symbol | mergeSymbol (const Symbol &L, const Symbol &R) |
std::unique_ptr< SymbolIndex > | createProjectAwareIndex (IndexFactory, bool Sync) |
Returns an index that answers queries using external indices. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, RefKind K) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Ref &R) |
RefKind | operator| (RefKind L, RefKind R) |
RefKind & | operator|= (RefKind &L, RefKind R) |
RefKind | operator& (RefKind A, RefKind B) |
bool | operator< (const Ref &L, const Ref &R) |
bool | operator== (const Ref &L, const Ref &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const RelationKind R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Relation &R) |
void | writeYAML (const IndexFileOut &, llvm::raw_ostream &) |
llvm::Expected< IndexFileIn > | readYAML (llvm::StringRef, SymbolOrigin Origin) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const IndexFileOut &O) |
llvm::Expected< IndexFileIn > | readIndexFile (llvm::StringRef Data, SymbolOrigin Origin) |
std::unique_ptr< SymbolIndex > | loadIndex (llvm::StringRef SymbolFilename, SymbolOrigin Origin, bool UseDex) |
std::string | toYAML (const Symbol &) |
std::string | toYAML (const std::pair< SymbolID, ArrayRef< Ref >> &) |
std::string | toYAML (const Relation &) |
std::string | toYAML (const Ref &) |
llvm::StringRef | getStdlibUmbrellaHeader (const LangOptions &LO) |
SymbolSlab | indexStandardLibrary (llvm::StringRef HeaderSources, std::unique_ptr< CompilerInvocation > CI, const StdLibLocation &Loc, const ThreadsafeFS &TFS) |
SymbolSlab | indexStandardLibrary (std::unique_ptr< CompilerInvocation > Invocation, const StdLibLocation &Loc, const ThreadsafeFS &TFS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, Symbol::SymbolFlag F) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Symbol &S) |
float | quality (const Symbol &S) |
Computes query-independent quality score for a Symbol. More... | |
static void | own (Symbol &S, llvm::UniqueStringSaver &Strings) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolSlab &Slab) |
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE () | |
Symbol::SymbolFlag | operator| (Symbol::SymbolFlag A, Symbol::SymbolFlag B) |
Symbol::SymbolFlag & | operator|= (Symbol::SymbolFlag &A, Symbol::SymbolFlag B) |
template<typename Callback > | |
void | visitStrings (Symbol &S, const Callback &CB) |
Invokes Callback with each StringRef& contained in the Symbol. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolID &ID) |
llvm::hash_code | hash_value (const SymbolID &ID) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolLocation &L) |
bool | operator== (const SymbolLocation::Position &L, const SymbolLocation::Position &R) |
bool | operator< (const SymbolLocation::Position &L, const SymbolLocation::Position &R) |
bool | operator== (const SymbolLocation &L, const SymbolLocation &R) |
bool | operator< (const SymbolLocation &L, const SymbolLocation &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, SymbolOrigin O) |
SymbolOrigin | operator| (SymbolOrigin A, SymbolOrigin B) |
SymbolOrigin & | operator|= (SymbolOrigin &A, SymbolOrigin B) |
SymbolOrigin | operator& (SymbolOrigin A, SymbolOrigin B) |
std::string | toYAML (const std::pair< SymbolID, llvm::ArrayRef< Ref >> &Data) |
std::vector< InlayHint > | inlayHints (ParsedAST &AST, std::optional< Range > RestrictRange) |
Compute and return inlay hints for a file. More... | |
std::unique_ptr< Transport > | newJSONTransport (std::FILE *In, llvm::raw_ostream &Out, llvm::raw_ostream *InMirror, bool Pretty, JSONStreamStyle Style) |
std::optional< std::string > | doPathMapping (llvm::StringRef S, PathMapping::Direction Dir, const PathMappings &Mappings) |
Returns a modified S with the first matching path in Mappings substituted, if applicable. More... | |
void | applyPathMappings (llvm::json::Value &Params, PathMapping::Direction Dir, const PathMappings &Mappings) |
Applies the Mappings to all the file:// URIs in Params . More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const PathMapping &M) |
llvm::Expected< PathMappings > | parsePathMappings (llvm::StringRef RawPathMappings) |
Parse the command line RawPathMappings (e.g. More... | |
std::unique_ptr< Transport > | createPathMappingTransport (std::unique_ptr< Transport > Transp, PathMappings Mappings) |
Creates a wrapping transport over Transp that applies the Mappings to all inbound and outbound LSP messages. More... | |
std::shared_ptr< const PreambleData > | buildPreamble (PathRef FileName, CompilerInvocation CI, const ParseInputs &Inputs, bool StoreInMemory, PreambleParsedCallback PreambleCallback, PreambleBuildStats *Stats=nullptr) |
Build a preamble for the new inputs unless an old one can be reused. More... | |
bool | isPreambleCompatible (const PreambleData &Preamble, const ParseInputs &Inputs, PathRef FileName, const CompilerInvocation &CI) |
Returns true if Preamble is reusable for Inputs . More... | |
void | escapeBackslashAndQuotes (llvm::StringRef Text, llvm::raw_ostream &OS) |
SourceLocation | translatePreamblePatchLocation (SourceLocation Loc, const SourceManager &SM) |
Translates locations inside preamble patch to their main-file equivalent using presumed locations. More... | |
bool | fromJSON (const llvm::json::Value &E, URIForFile &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const URIForFile &U) |
Serialize/deserialize URIForFile to/from a string URI. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const URIForFile &U) |
llvm::json::Value | toJSON (const TextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentIdentifier &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const VersionedTextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, VersionedTextDocumentIdentifier &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Position &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Position &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Position &P) |
bool | fromJSON (const llvm::json::Value &Params, Range &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Range &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Range &R) |
llvm::json::Value | toJSON (const Location &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Location &L) |
llvm::json::Value | toJSON (const ReferenceLocation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ReferenceLocation &L) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentItem &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextEdit &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const TextEdit &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const TextEdit &TE) |
bool | fromJSON (const llvm::json::Value &E, TraceLevel &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, SymbolKind &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, SymbolKindBitset &Out, llvm::json::Path P) |
SymbolKind | adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds) |
SymbolKind | indexSymbolKindToSymbolKind (index::SymbolKind Kind) |
bool | fromJSON (const llvm::json::Value &Params, ClientCapabilities &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, InitializeParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const WorkDoneProgressCreateParams &P) |
llvm::json::Value | toJSON (const WorkDoneProgressBegin &P) |
llvm::json::Value | toJSON (const WorkDoneProgressReport &P) |
llvm::json::Value | toJSON (const WorkDoneProgressEnd &P) |
llvm::json::Value | toJSON (const MessageType &R) |
llvm::json::Value | toJSON (const ShowMessageParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidOpenTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidCloseTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidSaveTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, FileChangeType &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, FileEvent &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeWatchedFilesParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentContentChangeEvent &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentRangeFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentOnTypeFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentSymbolParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const DiagnosticRelatedInformation &DRI) |
llvm::json::Value | toJSON (DiagnosticTag Tag) |
llvm::json::Value | toJSON (const CodeDescription &D) |
llvm::json::Value | toJSON (const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, Diagnostic &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const PublishDiagnosticsParams &PDP) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionContext &R, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceEdit &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ExecuteCommandParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const SymbolInformation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolInformation &SI) |
bool | operator== (const SymbolDetails &LHS, const SymbolDetails &RHS) |
llvm::json::Value | toJSON (const SymbolDetails &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolDetails &S) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceSymbolParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Command &C) |
llvm::json::Value | toJSON (const CodeAction &CA) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentSymbol &S) |
llvm::json::Value | toJSON (const DocumentSymbol &S) |
llvm::json::Value | toJSON (const WorkspaceEdit &WE) |
bool | fromJSON (const llvm::json::Value &Params, TweakArgs &A, llvm::json::Path P) |
llvm::json::Value | toJSON (const TweakArgs &A) |
llvm::json::Value | toJSON (const ApplyWorkspaceEditParams &Params) |
bool | fromJSON (const llvm::json::Value &Response, ApplyWorkspaceEditResponse &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentPositionParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CompletionContext &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CompletionParams &R, llvm::json::Path P) |
static llvm::StringRef | toTextKind (MarkupKind Kind) |
bool | fromJSON (const llvm::json::Value &V, MarkupKind &K, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, MarkupKind K) |
llvm::json::Value | toJSON (const MarkupContent &MC) |
llvm::json::Value | toJSON (const Hover &H) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKind &Out, llvm::json::Path P) |
CompletionItemKind | adjustKindToCapability (CompletionItemKind Kind, CompletionItemKindBitset &SupportedCompletionItemKinds) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKindBitset &Out, llvm::json::Path P) |
llvm::json::Value | toJSON (const CompletionItem &CI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const CompletionItem &I) |
bool | operator< (const CompletionItem &L, const CompletionItem &R) |
llvm::json::Value | toJSON (const CompletionList &L) |
llvm::json::Value | toJSON (const ParameterInformation &PI) |
llvm::json::Value | toJSON (const SignatureInformation &SI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SignatureInformation &I) |
llvm::json::Value | toJSON (const SignatureHelp &SH) |
bool | fromJSON (const llvm::json::Value &Params, RenameParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const DocumentHighlight &DH) |
llvm::json::Value | toJSON (const FileStatus &FStatus) |
static llvm::json::Value | encodeTokens (llvm::ArrayRef< SemanticToken > Toks) |
bool | operator== (const SemanticToken &L, const SemanticToken &R) |
llvm::json::Value | toJSON (const SemanticTokens &Tokens) |
llvm::json::Value | toJSON (const SemanticTokensEdit &Edit) |
llvm::json::Value | toJSON (const SemanticTokensOrDelta &TE) |
bool | fromJSON (const llvm::json::Value &Params, SemanticTokensParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, SemanticTokensDeltaParams &R, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentHighlight &V) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeConfigurationParams &CCP, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ClangdCompileCommand &CDbUpdate, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ConfigurationSettings &S, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, InitializationOptions &Opts, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, TypeHierarchyDirection &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyPrepareParams &R, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const TypeHierarchyItem &I) |
llvm::json::Value | toJSON (const TypeHierarchyItem::ResolveParams &RP) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyItem::ResolveParams &RP, llvm::json::Path P) |
llvm::json::Value | toJSON (const TypeHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyItem &I, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ResolveTypeHierarchyItemParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceContext &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (SymbolTag Tag) |
llvm::json::Value | toJSON (const CallHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyItem &I, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyIncomingCallsParams &C, llvm::json::Path P) |
llvm::json::Value | toJSON (const CallHierarchyIncomingCall &C) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyOutgoingCallsParams &C, llvm::json::Path P) |
llvm::json::Value | toJSON (const CallHierarchyOutgoingCall &C) |
bool | fromJSON (const llvm::json::Value &Params, InlayHintsParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const InlayHintKind &Kind) |
llvm::json::Value | toJSON (const InlayHint &H) |
bool | operator== (const InlayHint &A, const InlayHint &B) |
bool | operator< (const InlayHint &A, const InlayHint &B) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, InlayHintKind Kind) |
static const char * | toString (OffsetEncoding OE) |
llvm::json::Value | toJSON (const OffsetEncoding &OE) |
bool | fromJSON (const llvm::json::Value &V, OffsetEncoding &OE, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, OffsetEncoding Enc) |
bool | fromJSON (const llvm::json::Value &Params, SelectionRangeParams &S, llvm::json::Path P) |
llvm::json::Value | toJSON (const SelectionRange &Out) |
bool | fromJSON (const llvm::json::Value &Params, DocumentLinkParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const DocumentLink &DocumentLink) |
bool | fromJSON (const llvm::json::Value &Params, FoldingRangeParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const FoldingRange &Range) |
llvm::json::Value | toJSON (const MemoryTree &MT) |
Keys starting with an underscore(_) represent leaves, e.g. More... | |
bool | fromJSON (const llvm::json::Value &Params, ASTParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const ASTNode &N) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ASTNode &Root) |
bool | fromJSON (const llvm::json::Value &E, SymbolID &S, llvm::json::Path P) |
llvm::json::Value | toJSON (const SymbolID &S) |
bool | operator== (const TextEdit &L, const TextEdit &R) |
llvm::json::Value | toJSON (const NoParams &) |
bool | fromJSON (const llvm::json::Value &, NoParams &, llvm::json::Path) |
template<typename T > | |
llvm::json::Value | toJSON (const ProgressParams< T > &P) |
bool | fromJSON (const TypeHierarchyItem::ResolveParams &) |
static bool | hasDeclInMainFile (const Decl &D) |
static bool | hasUsingDeclInMainFile (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const NamedDecl &ND) |
static SymbolQualitySignals::SymbolCategory | categorize (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const index::SymbolInfo &D) |
static bool | isInstanceMember (const NamedDecl *ND) |
static bool | isInstanceMember (const index::SymbolInfo &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolQualitySignals &S) |
static SymbolRelevanceSignals::AccessibleScope | computeScope (const NamedDecl *D) |
static float | fileProximityScore (unsigned FileDistance) |
static float | scopeProximityScore (unsigned ScopeDistance) |
static std::optional< llvm::StringRef > | wordMatching (llvm::StringRef Name, const llvm::StringSet<> *ContextWords) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolRelevanceSignals &S) |
float | evaluateSymbolAndRelevance (float SymbolQuality, float SymbolRelevance) |
Combine symbol quality and relevance into a single score. More... | |
static uint32_t | encodeFloat (float F) |
std::string | sortText (float Score, llvm::StringRef Tiebreak="") |
Returns a string that sorts in the same order as (-Score, Tiebreak), for LSP. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SignatureQualitySignals &S) |
SourceLocation | insertionPoint (const DeclContext &DC, llvm::ArrayRef< Anchor > Anchors) |
llvm::Expected< tooling::Replacement > | insertDecl (llvm::StringRef Code, const DeclContext &DC, llvm::ArrayRef< Anchor > Anchors) |
SourceLocation | insertionPoint (const CXXRecordDecl &InClass, std::vector< Anchor > Anchors, AccessSpecifier Protection) |
llvm::Expected< tooling::Replacement > | insertDecl (llvm::StringRef Code, const CXXRecordDecl &InClass, std::vector< Anchor > Anchors, AccessSpecifier Protection) |
llvm::Expected< RenameResult > | rename (const RenameInputs &RInputs) |
Renames all occurrences of the symbol. More... | |
llvm::Expected< Edit > | buildRenameEdit (llvm::StringRef AbsFilePath, llvm::StringRef InitialCode, std::vector< Range > Occurrences, llvm::StringRef NewName) |
Generates rename edits that replaces all given occurrences with the NewName. More... | |
std::optional< std::vector< Range > > | adjustRenameRanges (llvm::StringRef DraftCode, llvm::StringRef Identifier, std::vector< Range > Indexed, const LangOptions &LangOpts) |
Adjusts indexed occurrences to match the current state of the file. More... | |
std::optional< std::vector< Range > > | getMappedRanges (ArrayRef< Range > Indexed, ArrayRef< Range > Lexed) |
Calculates the lexed occurrences that the given indexed occurrences map to. More... | |
size_t | renameRangeAdjustmentCost (ArrayRef< Range > Indexed, ArrayRef< Range > Lexed, ArrayRef< size_t > MappedIndex) |
Evaluates how good the mapped result is. More... | |
std::vector< std::unique_ptr< Tweak > > | prepareTweaks (const Tweak::Selection &S, llvm::function_ref< bool(const Tweak &)> Filter, const FeatureModuleSet *Modules) |
Calls prepare() on all tweaks that satisfy the filter, returning those that can run on the selection. More... | |
llvm::Expected< std::unique_ptr< Tweak > > | prepareTweak (StringRef ID, const Tweak::Selection &S, const FeatureModuleSet *Modules) |
llvm::SmallString< 256 > | abbreviatedString (DynTypedNode N, const PrintingPolicy &PP) |
static llvm::SmallVector< std::pair< unsigned, unsigned >, 2 > | pointBounds (unsigned Offset, const syntax::TokenBuffer &Tokens) |
std::vector< HighlightingToken > | getSemanticHighlightings (ParsedAST &AST) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, HighlightingKind K) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, HighlightingModifier K) |
bool | operator== (const HighlightingToken &L, const HighlightingToken &R) |
bool | operator< (const HighlightingToken &L, const HighlightingToken &R) |
std::vector< SemanticToken > | toSemanticTokens (llvm::ArrayRef< HighlightingToken > Tokens, llvm::StringRef Code) |
llvm::StringRef | toSemanticTokenType (HighlightingKind Kind) |
llvm::StringRef | toSemanticTokenModifier (HighlightingModifier Modifier) |
std::vector< SemanticTokensEdit > | diffTokens (llvm::ArrayRef< SemanticToken > Old, llvm::ArrayRef< SemanticToken > New) |
llvm::Expected< SelectionRange > | getSemanticRanges (ParsedAST &AST, Position Pos) |
Returns the list of all interesting ranges around the Position Pos . More... | |
llvm::Expected< std::vector< FoldingRange > > | getFoldingRanges (ParsedAST &AST) |
Returns a list of ranges whose contents might be collapsible in an editor. More... | |
llvm::Expected< std::vector< FoldingRange > > | getFoldingRanges (const std::string &Code, bool LineFoldingOnly) |
Returns a list of ranges whose contents might be collapsible in an editor. More... | |
template<typename Callback > | |
static bool | iterateCodepoints (llvm::StringRef U8, const Callback &CB) |
static size_t | measureUnits (llvm::StringRef U8, int Units, OffsetEncoding Enc, bool &Valid) |
static OffsetEncoding | lspEncoding () |
size_t | lspLength (llvm::StringRef Code) |
llvm::Expected< size_t > | positionToOffset (llvm::StringRef Code, Position P, bool AllowColumnsBeyondLineLength=true) |
Turn a [line, column] pair into an offset in Code. More... | |
Position | offsetToPosition (llvm::StringRef Code, size_t Offset) |
Turn an offset in Code into a [line, column] pair. More... | |
Position | sourceLocToPosition (const SourceManager &SM, SourceLocation Loc) |
Turn a SourceLocation into a [line, column] pair. More... | |
bool | isSpelledInSource (SourceLocation Loc, const SourceManager &SM) |
Returns true if the token at Loc is spelled in the source code. More... | |
bool | isValidFileRange (const SourceManager &Mgr, SourceRange R) |
Returns true iff all of the following conditions hold: More... | |
SourceLocation | includeHashLoc (FileID IncludedFile, const SourceManager &SM) |
Returns the #include location through which IncludedFIle was loaded. More... | |
static unsigned | getTokenLengthAtLoc (SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceLocation | getLocForTokenEnd (SourceLocation BeginLoc, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceLocation | getLocForTokenBegin (SourceLocation EndLoc, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceRange | toTokenRange (CharSourceRange Range, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceRange | unionTokenRange (SourceRange R1, SourceRange R2, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceRange | rangeInCommonFile (SourceRange R, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceRange | getExpansionTokenRangeInSameFile (SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts) |
static SourceRange | getTokenFileRange (SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts) |
bool | isInsideMainFile (SourceLocation Loc, const SourceManager &SM) |
Returns true iff Loc is inside the main file. More... | |
std::optional< SourceRange > | toHalfOpenFileRange (const SourceManager &Mgr, const LangOptions &LangOpts, SourceRange R) |
Turns a token range into a half-open range and checks its correctness. More... | |
llvm::StringRef | toSourceCode (const SourceManager &SM, SourceRange R) |
Returns the source code covered by the source range. More... | |
llvm::Expected< SourceLocation > | sourceLocationInMainFile (const SourceManager &SM, Position P) |
Return the file location, corresponding to P . More... | |
Range | halfOpenToRange (const SourceManager &SM, CharSourceRange R) |
void | unionRanges (Range &A, Range B) |
std::pair< size_t, size_t > | offsetToClangLineColumn (llvm::StringRef Code, size_t Offset) |
std::pair< StringRef, StringRef > | splitQualifiedName (StringRef QName) |
TextEdit | replacementToEdit (llvm::StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (llvm::StringRef Code, const tooling::Replacements &Repls) |
std::optional< std::string > | getCanonicalPath (const FileEntry *F, const SourceManager &SourceMgr) |
Get the canonical path of F . More... | |
TextEdit | toTextEdit (const FixItHint &FixIt, const SourceManager &M, const LangOptions &L) |
FileDigest | digest (llvm::StringRef Content) |
std::optional< FileDigest > | digestFile (const SourceManager &SM, FileID FID) |
format::FormatStyle | getFormatStyleForFile (llvm::StringRef File, llvm::StringRef Content, const ThreadsafeFS &TFS) |
Choose the clang-format style we should apply to a certain file. More... | |
llvm::Expected< tooling::Replacements > | cleanupAndFormat (StringRef Code, const tooling::Replacements &Replaces, const format::FormatStyle &Style) |
Cleanup and format the given replacements. More... | |
static void | lex (llvm::StringRef Code, const LangOptions &LangOpts, llvm::function_ref< void(const syntax::Token &, const SourceManager &SM)> Action) |
llvm::StringMap< unsigned > | collectIdentifiers (llvm::StringRef Content, const format::FormatStyle &Style) |
Collects identifiers with counts in the source code. More... | |
std::vector< Range > | collectIdentifierRanges (llvm::StringRef Identifier, llvm::StringRef Content, const LangOptions &LangOpts) |
Collects all ranges of the given identifier in the source code. More... | |
bool | isKeyword (llvm::StringRef TokenName, const LangOptions &LangOpts) |
Return true if the TokenName is in the list of reversed keywords of the language. More... | |
std::vector< std::string > | visibleNamespaces (llvm::StringRef Code, const LangOptions &LangOpts) |
Heuristically determine namespaces visible at a point, without parsing Code. More... | |
llvm::StringSet | collectWords (llvm::StringRef Content) |
Collects words from the source code. More... | |
static bool | isLikelyIdentifier (llvm::StringRef Word, llvm::StringRef Before, llvm::StringRef After) |
std::optional< DefinedMacro > | locateMacroAt (const syntax::Token &SpelledTok, Preprocessor &PP) |
Gets the macro referenced by SpelledTok . More... | |
llvm::Error | reformatEdit (Edit &E, const format::FormatStyle &Style) |
Formats the edits and code around it according to Style. More... | |
static void | inferFinalNewline (llvm::Expected< size_t > &Err, std::string &Contents, const Position &Pos) |
llvm::Error | applyChange (std::string &Contents, const TextDocumentContentChangeEvent &Change) |
Apply an incremental update to a text document. More... | |
EligibleRegion | getEligiblePoints (llvm::StringRef Code, llvm::StringRef FullyQualifiedName, const LangOptions &LangOpts) |
Returns most eligible region to insert a definition for FullyQualifiedName in the Code . More... | |
bool | isHeaderFile (llvm::StringRef FileName, std::optional< LangOptions > LangOpts=std::nullopt) |
Infers whether this is a header from the FileName and LangOpts (if presents). More... | |
bool | isProtoFile (SourceLocation Loc, const SourceManager &SourceMgr) |
Returns true if the given location is in a generated protobuf file. More... | |
FileDigest | digest (StringRef Content) |
size_t | lspLength (StringRef Code) |
std::pair< llvm::StringRef, llvm::StringRef > | splitQualifiedName (llvm::StringRef QName) |
From "a::b::c", return {"a::b::", "c"}. More... | |
TextEdit | replacementToEdit (StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (StringRef Code, const tooling::Replacements &Repls) |
bool | isReservedName (llvm::StringRef Name) |
Returns true if Name is reserved, like _Foo or __Vector_base. More... | |
std::pair< Context, Canceler > | cancelableTask (int Reason=1) |
Defines a new task whose cancellation may be requested. More... | |
int | isCancelled (const Context &Ctx=Context::current()) |
If the current context is within a cancelled task, returns the reason. More... | |
static Context & | currentContext () |
template<typename... Ts> | |
void | elog (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
void | log (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
void | vlog (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
llvm::Error | error (std::error_code EC, const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
llvm::Error | error (const char *Fmt, Ts &&... Vals) |
llvm::Error | error (std::error_code EC, std::string Msg) |
llvm::Error | error (std::string Msg) |
void | record (const MemoryTree &MT, std::string RootName, const trace::Metric &Out) |
Records total memory usage of each node under Out . More... | |
std::string | maybeCaseFoldPath (PathRef Path) |
bool | pathEqual (PathRef A, PathRef B) |
PathRef | absoluteParent (PathRef Path) |
Variant of parent_path that operates only on absolute paths. More... | |
bool | pathStartsWith (PathRef Ancestor, PathRef Path, llvm::sys::path::Style Style=llvm::sys::path::Style::native) |
Checks if Ancestor is a proper ancestor of Path . More... | |
void | abortAfterTimeout (std::chrono::seconds Timeout) |
Causes this process to crash if still running after Timeout. More... | |
void | requestShutdown () |
Sets a flag to indicate that clangd was sent a shutdown signal, and the transport loop should exit at the next opportunity. More... | |
bool | shutdownRequested () |
Checks whether requestShutdown() was called. More... | |
template<typename Fun , typename Ret = decltype(std::declval<Fun>()())> | |
Ret | retryAfterSignalUnlessShutdown (const std::enable_if_t< true, Ret > &Fail, const Fun &F) |
Retry an operation if it gets interrupted by a signal. More... | |
Deadline | timeoutSeconds (std::optional< double > Seconds) |
Makes a deadline from a timeout in seconds. None means wait forever. More... | |
void | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D) |
Wait once on CV for the specified duration. More... | |
template<typename Func > | |
bool | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D, Func F) |
Waits on a condition variable until F() is true or D expires. More... | |
template<typename T > | |
std::future< T > | runAsync (llvm::unique_function< T()> Action) |
Runs Action asynchronously with a new std::thread. More... | |
static void | mergeCheckList (std::optional< std::string > &Checks, llvm::StringRef List) |
TidyProviderRef | provideEnvironment () |
Provider that just sets the defaults. More... | |
TidyProviderRef | provideDefaultChecks () |
Provider that will enable a nice set of default checks if none are specified. More... | |
TidyProvider | addTidyChecks (llvm::StringRef Checks, llvm::StringRef WarningsAsErrors={}) |
Provider the enables a specific set of checks and warnings as errors. More... | |
TidyProvider | disableUnusableChecks (llvm::ArrayRef< std::string > ExtraBadChecks={}) |
Provider that will disable checks known to not work with clangd. More... | |
TidyProviderRef | provideClangdConfig () |
TidyProvider | provideClangTidyFiles (ThreadsafeFS &) |
Provider that searches for .clang-tidy configuration files in the directory tree. More... | |
TidyProvider | combine (std::vector< TidyProvider > Providers) |
tidy::ClangTidyOptions | getTidyOptionsForFile (TidyProviderRef Provider, llvm::StringRef Filename) |
bool | isRegisteredTidyCheck (llvm::StringRef Check) |
Returns if Check is a registered clang-tidy check. More... | |
bool | check (llvm::StringRef File, const ThreadsafeFS &TFS, const ClangdLSPServer::Options &Opts) |
unsigned | getDefaultAsyncThreadsCount () |
Returns a number of a default async threads to use for TUScheduler. More... | |
static clangd::Range | toLSPRange (llvm::StringRef Code, llvm::Annotations::Range R) |
MATCHER_P (named, N, "") | |
MATCHER_P (qName, N, "") | |
MATCHER (declared, "") | |
MATCHER (defined, "") | |
MATCHER_P (fileURI, F, "") | |
::testing::Matcher< const RefSlab & > | refsAre (std::vector<::testing::Matcher< Ref >> Matchers) |
MATCHER (emptyIncludeNode, "") | |
MATCHER (hadErrors, "") | |
MATCHER_P (numReferences, N, "") | |
TEST_F (BackgroundIndexTest, NoCrashOnErrorFile) | |
TEST_F (BackgroundIndexTest, Config) | |
TEST_F (BackgroundIndexTest, IndexTwoFiles) | |
TEST_F (BackgroundIndexTest, MainFileRefs) | |
TEST_F (BackgroundIndexTest, ShardStorageTest) | |
TEST_F (BackgroundIndexTest, DirectIncludesTest) | |
TEST_F (BackgroundIndexTest, ShardStorageLoad) | |
TEST_F (BackgroundIndexTest, ShardStorageEmptyFile) | |
TEST_F (BackgroundIndexTest, NoDotsInAbsPath) | |
TEST_F (BackgroundIndexTest, UncompilableFiles) | |
TEST_F (BackgroundIndexTest, CmdLineHash) | |
TEST_F (BackgroundIndexTest, Reindex) | |
TEST_F (BackgroundIndexRebuilderTest, IndexingTUs) | |
TEST_F (BackgroundIndexRebuilderTest, LoadingShards) | |
TEST (BackgroundQueueTest, Priority) | |
TEST (BackgroundQueueTest, Boost) | |
TEST (BackgroundQueueTest, Duplicates) | |
TEST (BackgroundQueueTest, Progress) | |
TEST (BackgroundIndex, Profile) | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const CallHierarchyItem &Item) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const CallHierarchyIncomingCall &Call) |
TEST (DecisionForestRuntime, Evaluate) | |
MATCHER_P2 (hasFlag, Flag, Path, "") | |
auto | hasFlag (llvm::StringRef Flag) |
TEST_F (DirectoryBasedGlobalCompilationDatabaseCacheTest, Cacheable) | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const InlayHint &Hint) |
static void | logBody (llvm::StringRef Method, llvm::json::Value V, bool Send) |
template<typename... Args> | |
PolySubsequenceMatcher< Args... > | HasSubsequence (Args &&... M) |
template<typename InnerMatcher > | |
OptionalMatcher< InnerMatcher > | HasValue (const InnerMatcher &inner_matcher) |
std::unique_ptr< SymbolIndex > | createIndex () |
TEST (ProjectAware, Test) | |
TEST (ProjectAware, CreatedOnce) | |
TEST (ContextTests, Simple) | |
TEST (ContextTests, MoveOps) | |
TEST (ContextTests, Builders) | |
TEST_F (ThreadingTest, TaskRunner) | |
TEST_F (ThreadingTest, Memoize) | |
TEST_F (ThreadingTest, MemoizeDeterministic) | |
TEST (PeriodicThrottlerTest, Minimal) | |
void | runAddDocument (ClangdServer &Server, PathRef File, llvm::StringRef Contents, llvm::StringRef Version, WantDiagnostics WantDiags, bool ForceRebuild) |
llvm::Expected< CodeCompleteResult > | runCodeComplete (ClangdServer &Server, PathRef File, Position Pos, clangd::CodeCompleteOptions Opts) |
llvm::Expected< SignatureHelp > | runSignatureHelp (ClangdServer &Server, PathRef File, Position Pos, MarkupKind DocumentationFormat) |
llvm::Expected< std::vector< LocatedSymbol > > | runLocateSymbolAt (ClangdServer &Server, PathRef File, Position Pos) |
llvm::Expected< std::vector< DocumentHighlight > > | runFindDocumentHighlights (ClangdServer &Server, PathRef File, Position Pos) |
llvm::Expected< RenameResult > | runRename (ClangdServer &Server, PathRef File, Position Pos, llvm::StringRef NewName, const RenameOptions &RenameOpts) |
llvm::Expected< RenameResult > | runPrepareRename (ClangdServer &Server, PathRef File, Position Pos, std::optional< std::string > NewName, const RenameOptions &RenameOpts) |
llvm::Expected< tooling::Replacements > | runFormatFile (ClangdServer &Server, PathRef File, std::optional< Range > Rng) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, llvm::StringRef Query) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, const FuzzyFindRequest &Req) |
RefSlab | getRefs (const SymbolIndex &Index, SymbolID ID) |
llvm::Expected< std::vector< SelectionRange > > | runSemanticRanges (ClangdServer &Server, PathRef File, const std::vector< Position > &Pos) |
llvm::Expected< std::optional< clangd::Path > > | runSwitchHeaderSource (ClangdServer &Server, PathRef File) |
llvm::Error | runCustomAction (ClangdServer &Server, PathRef File, llvm::function_ref< void(InputsAndAST)> Action) |
void | runAddDocument (ClangdServer &Server, PathRef File, StringRef Contents, StringRef Version="null", WantDiagnostics WantDiags=WantDiagnostics::Auto, bool ForceRebuild=false) |
llvm::Expected< RenameResult > | runRename (ClangdServer &Server, PathRef File, Position Pos, StringRef NewName, const clangd::RenameOptions &RenameOpts) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, StringRef Query) |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | buildTestFS (llvm::StringMap< std::string > const &Files, llvm::StringMap< time_t > const &Timestamps) |
const char * | testRoot () |
std::string | testPath (PathRef File, llvm::sys::path::Style Style) |
static URISchemeRegistry::Add< TestScheme > | X (TestScheme::Scheme, "Test schema") |
Symbol | symbol (llvm::StringRef QName) |
static std::string | replace (llvm::StringRef Haystack, llvm::StringRef Needle, llvm::StringRef Repl) |
Symbol | sym (llvm::StringRef QName, index::SymbolKind Kind, llvm::StringRef USRFormat) |
Symbol | func (llvm::StringRef Name) |
Symbol | cls (llvm::StringRef Name) |
Symbol | enm (llvm::StringRef Name) |
Symbol | enmConstant (llvm::StringRef Name) |
Symbol | var (llvm::StringRef Name) |
Symbol | ns (llvm::StringRef Name) |
Symbol | conceptSym (llvm::StringRef Name) |
Symbol | objcSym (llvm::StringRef Name, index::SymbolKind Kind, llvm::StringRef USRPrefix) |
Symbol | objcClass (llvm::StringRef Name) |
Symbol | objcCategory (llvm::StringRef Name, llvm::StringRef CategoryName) |
Symbol | objcProtocol (llvm::StringRef Name) |
SymbolSlab | generateSymbols (std::vector< std::string > QualifiedNames) |
SymbolSlab | generateNumSymbols (int Begin, int End) |
std::string | getQualifiedName (const Symbol &Sym) |
std::vector< std::string > | match (const SymbolIndex &I, const FuzzyFindRequest &Req, bool *Incomplete) |
std::vector< std::string > | lookup (const SymbolIndex &I, llvm::ArrayRef< SymbolID > IDs) |
void | initializeModuleCache (CompilerInvocation &CI) |
void | deleteModuleCache (const std::string ModuleCachePath) |
const Symbol & | findSymbol (const SymbolSlab &Slab, llvm::StringRef QName) |
const NamedDecl & | findDecl (ParsedAST &AST, llvm::StringRef QName) |
const NamedDecl & | findDecl (ParsedAST &AST, std::function< bool(const NamedDecl &)> Filter) |
const NamedDecl & | findUnqualifiedDecl (ParsedAST &AST, llvm::StringRef Name) |
MATCHER_P2 (FileWithContents, FileName, Contents, "") | |
xpc_object_t | jsonToXpc (const json::Value &JSON) |
json::Value | xpcToJson (const xpc_object_t &XPCObject) |
xpc_object_t | jsonToXpc (const llvm::json::Value &JSON) |
std::unique_ptr< Transport > | newXPCTransport () |
std::vector< LocatedSymbol > | locateSymbolTextually (const SpelledWord &Word, ParsedAST &AST, const SymbolIndex *Index, llvm::StringRef MainFilePath, ASTNodeKind NodeKind) |
const syntax::Token * | findNearbyIdentifier (const SpelledWord &Word, const syntax::TokenBuffer &TB) |
std::vector< LocatedSymbol > | locateSymbolAt (ParsedAST &AST, Position Pos, const SymbolIndex *Index=nullptr) |
Get definition of symbol at a specified Pos . More... | |
std::vector< DocumentLink > | getDocumentLinks (ParsedAST &AST) |
Get all document links. More... | |
std::vector< DocumentHighlight > | findDocumentHighlights (ParsedAST &AST, Position Pos) |
Returns highlights for all usages of a symbol at Pos . More... | |
std::vector< LocatedSymbol > | findImplementations (ParsedAST &AST, Position Pos, const SymbolIndex *Index) |
Returns implementations at a specified Pos: More... | |
ReferencesResult | findReferences (ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index=nullptr, bool AddContext=false) |
Returns references of the symbol at a specified Pos . More... | |
std::vector< SymbolDetails > | getSymbolInfo (ParsedAST &AST, Position Pos) |
Get info about symbols at Pos . More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const LocatedSymbol &S) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ReferencesResult::Reference &R) |
template<typename HierarchyItem > | |
static std::optional< HierarchyItem > | declToHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
static std::optional< TypeHierarchyItem > | declToTypeHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
static std::optional< CallHierarchyItem > | declToCallHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
template<typename HierarchyItem > | |
static std::optional< HierarchyItem > | symbolToHierarchyItem (const Symbol &S, PathRef TUPath) |
static std::optional< TypeHierarchyItem > | symbolToTypeHierarchyItem (const Symbol &S, PathRef TUPath) |
static std::optional< CallHierarchyItem > | symbolToCallHierarchyItem (const Symbol &S, PathRef TUPath) |
static void | fillSubTypes (const SymbolID &ID, std::vector< TypeHierarchyItem > &SubTypes, const SymbolIndex *Index, int Levels, PathRef TUPath) |
static void | fillSuperTypes (const CXXRecordDecl &CXXRD, llvm::StringRef TUPath, TypeHierarchyItem &Item, RecursionProtectionSet &RPSet) |
std::vector< const CXXRecordDecl * > | findRecordTypeAt (ParsedAST &AST, Position Pos) |
Find the record types referenced at Pos . More... | |
static QualType | typeForNode (const SelectionTree::Node *N) |
static void | unwrapFindType (QualType T, const HeuristicResolver *H, llvm::SmallVector< QualType > &Out) |
static llvm::SmallVector< QualType > | unwrapFindType (QualType T, const HeuristicResolver *H) |
std::vector< LocatedSymbol > | findType (ParsedAST &AST, Position Pos) |
Returns symbols for types referenced at Pos . More... | |
std::vector< const CXXRecordDecl * > | typeParents (const CXXRecordDecl *CXXRD) |
Given a record type declaration, find its base (parent) types. More... | |
std::vector< TypeHierarchyItem > | getTypeHierarchy (ParsedAST &AST, Position Pos, int Resolve, TypeHierarchyDirection Direction, const SymbolIndex *Index=nullptr, PathRef TUPath=PathRef{}) |
Get type hierarchy information at Pos . More... | |
std::optional< std::vector< TypeHierarchyItem > > | superTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index) |
Returns direct parents of a TypeHierarchyItem using SymbolIDs stored inside the item. More... | |
std::vector< TypeHierarchyItem > | subTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index) |
Returns direct children of a TypeHierarchyItem. More... | |
void | resolveTypeHierarchy (TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index) |
std::vector< CallHierarchyItem > | prepareCallHierarchy (ParsedAST &AST, Position Pos, PathRef TUPath) |
Get call hierarchy information at Pos . More... | |
std::vector< CallHierarchyIncomingCall > | incomingCalls (const CallHierarchyItem &Item, const SymbolIndex *Index) |
llvm::DenseSet< const Decl * > | getNonLocalDeclRefs (ParsedAST &AST, const FunctionDecl *FD) |
Returns all decls that are referenced in the FD except local symbols. More... | |
Variables | |
static bool | AllowCrashPragmasForTest = false |
static constexpr int | AwfulScore = -(1 << 13) |
static constexpr int | PerfectBonus = 4 |
constexpr static uint8_t | CharTypes [] |
constexpr static uint8_t | CharRoles [] |
const auto | NoFilter = [](const NamedDecl *D) { return true; } |
const auto | NonStaticFilter |
const auto | StaticFilter |
const auto | ValueFilter = [](const NamedDecl *D) { return isa<ValueDecl>(D); } |
const auto | TypeFilter = [](const NamedDecl *D) { return isa<TypeDecl>(D); } |
const auto | TemplateFilter |
static bool | AnalyzeStdlib = false |
static std::atomic< bool > | PreventStarvation = {false} |
constexpr int | MaxSuffixComponents = 3 |
The maximum number of path components in a key from StdSuffixHeaderMapping. More... | |
constexpr unsigned | SemanticTokenEncodingSize = 5 |
constexpr auto | CompletionItemKindMin |
constexpr auto | CompletionItemKindMax |
constexpr auto | SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
constexpr auto | SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
Key< OffsetEncoding > | kCurrentOffsetEncoding |
static Key< CancelState > | StateKey |
static constexpr uint64_t | CacheDiskMismatch |
static constexpr uint64_t | FileNotFound = CacheDiskMismatch - 1 |
static std::atomic< bool > | ShutdownRequested = {false} |
static thread_local ThreadCrashReporter * | CurrentReporter = nullptr |
static clang::clangd::Key< std::string > | FileBeingProcessed |
static int LLVM_ATTRIBUTE_UNUSED | UnittestSchemeAnchorDest |
volatile int | UnittestSchemeAnchorSource = 0 |
static int LLVM_ATTRIBUTE_UNUSED | UnittestSchemeAnchorDest |
using clang::clangd::Callback = typedef llvm::unique_function<void(llvm::Expected<T>)> |
A Callback<T> is a void function that accepts Expected<T>.
This is accepted by ClangdServer functions that logically return T.
Definition at line 28 of file Function.h.
using clang::clangd::Canceler = typedef std::function<void()> |
A canceller requests cancellation of a task, when called.
Calling it again has no effect.
Definition at line 70 of file Cancellation.h.
using clang::clangd::CharTypeSet = typedef unsigned char |
Definition at line 49 of file FuzzyMatch.h.
using clang::clangd::CompletionItemKindBitset = typedef std::bitset<CompletionItemKindMax + 1> |
Definition at line 338 of file Protocol.h.
using clang::clangd::FileDigest = typedef std::array<uint8_t, 8> |
Definition at line 42 of file SourceCode.h.
using clang::clangd::FileEdits = typedef llvm::StringMap<Edit> |
A mapping from absolute file path (the one used for accessing the underlying VFS) to edits.
Definition at line 205 of file SourceCode.h.
using clang::clangd::IncludeGraph = typedef llvm::StringMap<IncludeGraphNode> |
using clang::clangd::IndexFactory = typedef std::function<std::unique_ptr<SymbolIndex>( const Config::ExternalIndexSpec &, AsyncTaskRunner *)> |
A functor to create an index for an external index specification.
Functor should perform any high latency operation in a separate thread through AsyncTaskRunner, if set. Spec is never None
.
Definition at line 25 of file ProjectAware.h.
using clang::clangd::InitializedParams = typedef NoParams |
Definition at line 287 of file Protocol.h.
using clang::clangd::Obj = typedef llvm::json::Object |
Definition at line 173 of file LSPClient.cpp.
using clang::clangd::Path = typedef std::string |
using clang::clangd::PathMappings = typedef std::vector<PathMapping> |
Definition at line 42 of file PathMapping.h.
using clang::clangd::PathRef = typedef llvm::StringRef |
using clang::clangd::PreambleParsedCallback = typedef std::function<void(ASTContext &, Preprocessor &, const CanonicalIncludes &)> |
Definition at line 79 of file Preamble.h.
using clang::clangd::RecursionProtectionSet = typedef llvm::SmallSet<const CXXRecordDecl *, 4> |
using clang::clangd::SlabTuple = typedef std::tuple<SymbolSlab, RefSlab, RelationSlab> |
Definition at line 154 of file FileIndex.h.
using clang::clangd::SymbolKindBitset = typedef std::bitset<SymbolKindMax + 1> |
Definition at line 377 of file Protocol.h.
using clang::clangd::SystemIncludeExtractorFn = typedef llvm::unique_function<void( tooling::CompileCommand &, llvm::StringRef) const> |
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags.
Returns null when QueryDriverGlobs
is empty.
Definition at line 168 of file GlobalCompilationDatabase.h.
using clang::clangd::TidyProvider = typedef llvm::unique_function<void(tidy::ClangTidyOptions &, llvm::StringRef) const> |
A factory to modify a tidy::ClangTidyOptions.
Definition at line 23 of file TidyProvider.h.
using clang::clangd::TidyProviderRef = typedef llvm::function_ref<void(tidy::ClangTidyOptions &, llvm::StringRef)> |
A factory to modify a tidy::ClangTidyOptions that doesn't hold any state.
Definition at line 28 of file TidyProvider.h.
typedef llvm::Registry<Tweak> clang::clangd::TweakRegistry |
typedef llvm::Registry<URIScheme> clang::clangd::URISchemeRegistry |
enum clang::clangd::CharRole : unsigned char |
Enumerator | |
---|---|
Unknown | |
Tail | |
Head | |
Separator |
Definition at line 55 of file FuzzyMatch.h.
enum clang::clangd::CharType : unsigned char |
Enumerator | |
---|---|
Empty | |
Lower | |
Upper | |
Punctuation |
Definition at line 41 of file FuzzyMatch.h.
|
strong |
The kind of a completion entry.
Definition at line 304 of file Protocol.h.
|
strong |
Definition at line 1163 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
TemplateInstantiation | This is the template instantiation that was referred to. e.g. template<> class vector<int> (the implicit specialization) |
TemplatePattern | This is the pattern the template specialization was instantiated from. e.g. class vector<T> (the pattern within the primary template) |
Alias | This declaration is an alias that was referred to. e.g. using ns::X (the UsingDecl directly referenced), using Z = ns::Y (the TypeAliasDecl directly referenced) |
Underlying | This is the underlying declaration for a renaming-alias, decltype etc. e.g. class ns::Y (the underlying declaration referenced). Note that we don't treat |
Definition at line 93 of file FindTarget.h.
Definition at line 848 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Text | |
Read | |
Write |
Definition at line 1370 of file Protocol.h.
|
strong |
How to handle duplicated symbols across multiple files.
Enumerator | |
---|---|
PickOne | |
Merge |
Definition at line 50 of file FileIndex.h.
|
strong |
Enumerator | |
---|---|
ParseError | |
InvalidRequest | |
MethodNotFound | |
InvalidParams | |
InternalError | |
ServerNotInitialized | |
UnknownErrorCode | |
RequestCancelled | |
ContentModified |
Definition at line 47 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Created | The file got created. |
Changed | The file got changed. |
Deleted | The file got deleted. |
Definition at line 760 of file Protocol.h.
|
strong |
Definition at line 31 of file SemanticHighlighting.h.
|
strong |
Definition at line 64 of file SemanticHighlighting.h.
|
strong |
Describes what data is covered by an index.
Indexes may contain symbols but not references from a file, etc. This affects merging: if a staler index contains a reference but a fresher one does not, we want to trust the fresher index only if it actually includes references in general.
Enumerator | |
---|---|
None | |
Symbols | |
References | |
Relations | |
All |
|
strong |
Enumerator | |
---|---|
RIFF | |
YAML |
Definition at line 37 of file Serialization.h.
|
strong |
Select between in-memory index implementations, which have tradeoffs.
Enumerator | |
---|---|
Light | |
Heavy |
Definition at line 42 of file FileIndex.h.
|
strong |
Inlay hint kinds.
Definition at line 1574 of file Protocol.h.
|
strong |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Enumerator | |
---|---|
Missing | |
PlainText | The primary text to be inserted is treated as a plain string. |
Snippet | The primary text to be inserted is treated as a snippet. A snippet can define tab stops and placeholders with See also: https://github.com/Microsoft/vscode/blob/main/src/vs/editor/contrib/snippet/snippet.md |
Definition at line 1210 of file Protocol.h.
Enumerator | |
---|---|
Standard | |
Delimited |
Definition at line 66 of file Transport.h.
|
strong |
Enumerator | |
---|---|
PlainText | |
Markdown |
Definition at line 405 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Error | An error message. |
Warning | A warning message. |
Info | An information message. |
Log | A log message. |
Definition at line 680 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
UnsupportedEncoding | |
UTF16 | |
UTF8 | |
UTF32 |
Definition at line 389 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Queued | |
Building | |
Idle |
Definition at line 118 of file TUScheduler.h.
|
strong |
|
strong |
Enumerator | |
---|---|
BaseOf | |
OverriddenBy |
Definition at line 20 of file Relation.h.
|
strong |
A symbol kind.
Definition at line 346 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
AST | |
Open | |
Static | |
Merge | |
Identifier | |
Remote | |
Preamble | |
Background | |
StdLib |
Definition at line 21 of file SymbolOrigin.h.
|
strong |
Enumerator | |
---|---|
Deprecated |
Definition at line 1483 of file Protocol.h.
|
strong |
Defines how the host (editor) should sync document changes to the language server.
Definition at line 291 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Off | |
Messages | |
Verbose |
Definition at line 275 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Children | |
Parents | |
Both |
Definition at line 1398 of file Protocol.h.
|
strong |
Determines whether diagnostics should be generated for a file snapshot.
Enumerator | |
---|---|
Yes | |
No | Diagnostics must be generated for this snapshot. |
Auto | Diagnostics must not be generated for this snapshot. |
Definition at line 52 of file TUScheduler.h.
llvm::SmallString<256> clang::clangd::abbreviatedString | ( | DynTypedNode | N, |
const PrintingPolicy & | PP | ||
) |
Definition at line 989 of file Selection.cpp.
void clang::clangd::abortAfterTimeout | ( | std::chrono::seconds | Timeout | ) |
Causes this process to crash if still running after Timeout.
Definition at line 18 of file Shutdown.cpp.
Variant of parent_path that operates only on absolute paths.
Unlike parent_path doesn't consider C: a parent of C:.
Definition at line 22 of file Path.cpp.
References clang::tidy::modernize::empty().
TidyProvider clang::clangd::addTidyChecks | ( | llvm::StringRef | Checks, |
llvm::StringRef | WarningsAsErrors | ||
) |
Provider the enables a specific set of checks and warnings as errors.
Definition at line 186 of file TidyProvider.cpp.
References Checks(), and WarningsAsErrors().
CompletionItemKind clang::clangd::adjustKindToCapability | ( | CompletionItemKind | Kind, |
CompletionItemKindBitset & | SupportedCompletionItemKinds | ||
) |
Definition at line 979 of file Protocol.cpp.
References Class, CompletionItemKindMin, Enum, EnumMember, File, Folder, Kind, Struct, and Text.
SymbolKind clang::clangd::adjustKindToCapability | ( | SymbolKind | Kind, |
SymbolKindBitset & | SupportedSymbolKinds | ||
) |
Definition at line 248 of file Protocol.cpp.
References Class, Enum, EnumMember, Kind, String, Struct, and SymbolKindMin.
std::optional< std::vector< Range > > clang::clangd::adjustRenameRanges | ( | llvm::StringRef | DraftCode, |
llvm::StringRef | Identifier, | ||
std::vector< Range > | Indexed, | ||
const LangOptions & | LangOpts | ||
) |
Adjusts indexed occurrences to match the current state of the file.
The Index is not always up to date. Blindly editing at the locations reported by the index may mangle the code in such cases. This function determines whether the indexed occurrences can be applied to this file, and heuristically repairs the occurrences if necessary.
The API assumes that Indexed contains only named occurrences (each occurrence has the same length). REQUIRED: Indexed is sorted.
Definition at line 915 of file Rename.cpp.
References collectIdentifierRanges(), getMappedRanges(), Identifier, LangOpts, and Tracer.
void clang::clangd::allowCrashPragmasForTest | ( | ) |
Respect #pragma clang __debug crash
etc, which are usually disabled.
This may only be called before threads are spawned.
Definition at line 44 of file Compiler.cpp.
References AllowCrashPragmasForTest.
Referenced by main().
bool clang::clangd::allowImplicitCompletion | ( | llvm::StringRef | Content, |
unsigned | Offset | ||
) |
Definition at line 2276 of file CodeComplete.cpp.
References isIncludeFile(), Offset, and Pos.
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > clang::clangd::allTargetDecls | ( | const DynTypedNode & | , |
const HeuristicResolver * | |||
) |
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along with their DeclRelationSets.
This is suitable for indexing, where everything is recorded and filtering is applied later.
Definition at line 536 of file FindTarget.cpp.
llvm::Error clang::clangd::applyChange | ( | std::string & | Contents, |
const TextDocumentContentChangeEvent & | Change | ||
) |
Apply an incremental update to a text document.
Definition at line 1100 of file SourceCode.cpp.
void clang::clangd::applyPathMappings | ( | llvm::json::Value & | Params, |
PathMapping::Direction | Dir, | ||
const PathMappings & | Mappings | ||
) |
Applies the Mappings
to all the file:// URIs in Params
.
NOTE: The first matching mapping will be applied, otherwise Params
will be untouched.
Definition at line 48 of file PathMapping.cpp.
|
static |
Definition at line 951 of file ClangdLSPServer.cpp.
std::unique_ptr< CompilerInvocation > clang::clangd::buildCompilerInvocation | ( | const ParseInputs & | Inputs, |
clang::DiagnosticConsumer & | D, | ||
std::vector< std::string > * | CC1Args | ||
) |
Builds compiler invocation that could be used to build AST or preamble.
Definition at line 95 of file Compiler.cpp.
References CI, clang::clangd::ParseInputs::CompileCommand, ns1::ns2::D, disableUnsupportedOptions(), Inputs, clang::clangd::ParseInputs::TFS, and clang::clangd::ThreadsafeFS::view().
std::shared_ptr< const PreambleData > clang::clangd::buildPreamble | ( | PathRef | FileName, |
CompilerInvocation | CI, | ||
const ParseInputs & | Inputs, | ||
bool | StoreInMemory, | ||
PreambleParsedCallback | PreambleCallback, | ||
PreambleBuildStats * | Stats = nullptr |
||
) |
Build a preamble for the new inputs unless an old one can be reused.
If PreambleCallback
is set, it will be run on top of the AST while building the preamble. If Stats is not non-null, build statistics will be exported there.
Definition at line 473 of file Preamble.cpp.
llvm::Expected< Edit > clang::clangd::buildRenameEdit | ( | llvm::StringRef | AbsFilePath, |
llvm::StringRef | InitialCode, | ||
std::vector< Range > | Occurrences, | ||
llvm::StringRef | NewName | ||
) |
Generates rename edits that replaces all given occurrences with the NewName.
Exposed for testing only. REQUIRED: Occurrences is sorted and doesn't have duplicated ranges.
Definition at line 847 of file Rename.cpp.
References clang::clangd::detail::error(), clang::clangd::Position::line, Offset, positionToOffset(), SPAN_ATTACH, and Tracer.
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > clang::clangd::buildTestFS | ( | llvm::StringMap< std::string > const & | Files, |
llvm::StringMap< time_t > const & | Timestamps | ||
) |
Definition at line 33 of file TestFS.cpp.
References Files, InMemoryFileSystem, and testRoot().
Referenced by clang::clangd::MockFS::viewImpl().
CharTypeSet clang::clangd::calculateRoles | ( | llvm::StringRef | Text, |
llvm::MutableArrayRef< CharRole > | Roles | ||
) |
Definition at line 154 of file FuzzyMatch.cpp.
References CharTypes, Text, and Type.
Referenced by collectWords(), and clang::clangd::dex::identifierTrigrams().
Defines a new task whose cancellation may be requested.
The returned Context defines the scope of the task. When the context is active, isCancelled() is 0 until the Canceler is invoked, and equal to Reason afterwards. Conventionally, Reason may be the LSP error code to return.
Definition at line 24 of file Cancellation.cpp.
References clang::clangd::CancelState::Cancelled, clang::clangd::Context::current(), clang::clangd::Context::derive(), clang::clangd::Context::get(), clang::clangd::CancelState::Parent, and StateKey.
|
static |
Definition at line 48 of file FileDistance.cpp.
Referenced by clang::clangd::FileDistance::distance().
|
static |
Definition at line 83 of file Quality.cpp.
References categorize(), clang::clangd::SymbolQualitySignals::Constructor, clang::clangd::SymbolQualitySignals::Function, clang::clangd::SymbolQualitySignals::Keyword, clang::clangd::SymbolQualitySignals::Macro, clang::clangd::SymbolQualitySignals::Namespace, clang::clangd::SymbolQualitySignals::Type, and clang::clangd::SymbolQualitySignals::Variable.
|
static |
Definition at line 109 of file Quality.cpp.
References ns1::ns2::D, clang::clangd::SymbolQualitySignals::Macro, and clang::clangd::SymbolQualitySignals::Namespace.
|
static |
Definition at line 53 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Operator.
Referenced by categorize(), and clang::clangd::SymbolQualitySignals::merge().
bool clang::clangd::check | ( | llvm::StringRef | File, |
const ThreadsafeFS & | TFS, | ||
const ClangdLSPServer::Options & | Opts | ||
) |
llvm::Expected< tooling::Replacements > clang::clangd::cleanupAndFormat | ( | StringRef | Code, |
const tooling::Replacements & | Replaces, | ||
const format::FormatStyle & | Style | ||
) |
Cleanup and format the given replacements.
Definition at line 596 of file SourceCode.cpp.
Symbol clang::clangd::cls | ( | llvm::StringRef | Name | ) |
Definition at line 64 of file TestIndex.cpp.
CodeCompleteResult clang::clangd::codeComplete | ( | PathRef | FileName, |
Position | Pos, | ||
const PreambleData * | Preamble, | ||
const ParseInputs & | ParseInput, | ||
CodeCompleteOptions | Opts, | ||
SpeculativeFuzzyFind * | SpecFuzzyFind = nullptr |
||
) |
Gets code completions at a specified Pos
in FileName
.
If Preamble
is nullptr, this runs code completion without compiling the code.
If SpecFuzzyFind
is set, a speculative and asynchronous fuzzy find index request (based on cached request) will be run before parsing sema. In case the speculative result is used by code completion (e.g. speculation failed), the speculative result is not consumed, and SpecFuzzyFind
is only destroyed when the async request finishes.
Definition at line 2082 of file CodeComplete.cpp.
CodeCompleteResult clang::clangd::codeCompleteComment | ( | PathRef | FileName, |
unsigned | Offset, | ||
llvm::StringRef | Prefix, | ||
const PreambleData * | Preamble, | ||
const ParseInputs & | ParseInput | ||
) |
Definition at line 2022 of file CodeComplete.cpp.
std::vector<std::string> clang::clangd::collectAccessibleScopes | ( | Sema & | Sem, |
const DeclarationNameInfo & | Typo, | ||
Scope * | S, | ||
Sema::LookupNameKind | LookupKind | ||
) |
Returns all namespace scopes that the unqualified lookup would visit.
Definition at line 467 of file clangd/IncludeFixer.cpp.
References Ctx, Out, and printNamespaceScope().
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo().
std::vector< Range > clang::clangd::collectIdentifierRanges | ( | llvm::StringRef | Identifier, |
llvm::StringRef | Content, | ||
const LangOptions & | LangOpts | ||
) |
Collects all ranges of the given identifier in the source code.
Definition at line 630 of file SourceCode.cpp.
References LangOpts, and lex().
Referenced by adjustRenameRanges().
llvm::StringMap< unsigned > clang::clangd::collectIdentifiers | ( | llvm::StringRef | Content, |
const format::FormatStyle & | Style | ||
) |
Collects identifiers with counts in the source code.
Definition at line 616 of file SourceCode.cpp.
std::unique_ptr< CommentHandler > clang::clangd::collectIWYUHeaderMaps | ( | CanonicalIncludes * | Includes | ) |
Returns a CommentHandler that parses pragma comment on include files to determine when we should include a different header from the header that directly defines a symbol.
Mappinps are registered with Includes
.
Currently it only supports IWYU private pragma: https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private
We ignore other pragmas:
private
(somewhat common): Not incrementally useful as we support private.Definition at line 708 of file CanonicalIncludes.cpp.
std::unique_ptr< PPCallbacks > clang::clangd::collectPragmaMarksCallback | ( | const SourceManager & | SM, |
std::vector< PragmaMark > & | Out | ||
) |
Collect all pragma marks from the main file.
Definition at line 56 of file CollectMacros.cpp.
llvm::StringSet clang::clangd::collectWords | ( | llvm::StringRef | Content | ) |
Collects words from the source code.
Unlike collectIdentifiers:
Definition at line 849 of file SourceCode.cpp.
References calculateRoles().
TidyProvider clang::clangd::combine | ( | std::vector< TidyProvider > | Providers | ) |
Definition at line 273 of file TidyProvider.cpp.
|
static |
Definition at line 258 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::ClassScope, ns1::ns2::D, clang::clangd::SymbolRelevanceSignals::FileScope, clang::clangd::SymbolRelevanceSignals::FunctionScope, clang::clangd::SymbolRelevanceSignals::GlobalScope, and hasUnstableLinkage().
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
Definition at line 466 of file IncludeCleaner.cpp.
std::vector< const Inclusion * > clang::clangd::computeUnusedIncludesExperimental | ( | ParsedAST & | AST | ) |
Definition at line 477 of file IncludeCleaner.cpp.
Symbol clang::clangd::conceptSym | ( | llvm::StringRef | Name | ) |
Definition at line 84 of file TestIndex.cpp.
std::unique_ptr<SymbolIndex> clang::clangd::createIndex | ( | ) |
Definition at line 29 of file ProjectAwareIndexTests.cpp.
References clang::clangd::MemIndex::build(), Builder, and symbol().
std::unique_ptr< Transport > clang::clangd::createPathMappingTransport | ( | std::unique_ptr< Transport > | Transp, |
PathMappings | Mappings | ||
) |
Creates a wrapping transport over Transp
that applies the Mappings
to all inbound and outbound LSP messages.
All calls are then delegated to the regular transport (e.g. XPC, JSON).
Definition at line 190 of file PathMapping.cpp.
std::unique_ptr< SymbolIndex > clang::clangd::createProjectAwareIndex | ( | IndexFactory | , |
bool | Sync | ||
) |
Returns an index that answers queries using external indices.
IndexFactory specifies how to generate an index from an external source. If Sync
is set, index won't own any asnyc task runner. IndexFactory must be injected because this code cannot depend on the remote index client.
Definition at line 135 of file ProjectAware.cpp.
|
static |
Definition at line 187 of file FileDistance.cpp.
std::unique_ptr< FrontendAction > clang::clangd::createStaticIndexingAction | ( | SymbolCollector::Options | Opts, |
std::function< void(SymbolSlab)> | SymbolsCallback, | ||
std::function< void(RefSlab)> | RefsCallback, | ||
std::function< void(RelationSlab)> | RelationsCallback, | ||
std::function< void(IncludeGraph)> | IncludeGraphCallback | ||
) |
Definition at line 212 of file IndexAction.cpp.
|
static |
Definition at line 22 of file Context.cpp.
References C, and clang::clangd::Context::empty().
Referenced by clang::clangd::Context::current(), and clang::clangd::Context::swapCurrent().
QualType clang::clangd::declaredType | ( | const TypeDecl * | D | ) |
Definition at line 455 of file AST.cpp.
References ns1::ns2::D.
|
static |
|
static |
|
static |
Definition at line 1652 of file XRefs.cpp.
Referenced by fillSuperTypes().
void clang::clangd::deleteModuleCache | ( | const std::string | ModuleCachePath | ) |
Definition at line 90 of file TestTU.cpp.
std::vector< SemanticTokensEdit > clang::clangd::diffTokens | ( | llvm::ArrayRef< SemanticToken > | Old, |
llvm::ArrayRef< SemanticToken > | New | ||
) |
Definition at line 1264 of file SemanticHighlighting.cpp.
References Offset.
FileDigest clang::clangd::digest | ( | llvm::StringRef | Content | ) |
Definition at line 563 of file SourceCode.cpp.
FileDigest clang::clangd::digest | ( | StringRef | Content | ) |
std::optional< FileDigest > clang::clangd::digestFile | ( | const SourceManager & | SM, |
FileID | FID | ||
) |
Definition at line 573 of file SourceCode.cpp.
void clang::clangd::disableUnsupportedOptions | ( | CompilerInvocation & | CI | ) |
Clears CI
from options that are not supported by clangd, like codegen or plugins.
This should be combined with CommandMangler::adjust, which provides similar functionality for options that needs to be stripped from compile flags.
Definition at line 46 of file Compiler.cpp.
References AllowCrashPragmasForTest, and CI.
Referenced by buildCompilerInvocation().
TidyProvider clang::clangd::disableUnusableChecks | ( | llvm::ArrayRef< std::string > | ExtraBadChecks = {} | ) |
Provider that will disable checks known to not work with clangd.
ExtraBadChecks
specifies any other checks that should be always disabled.
Definition at line 196 of file TidyProvider.cpp.
std::optional< std::string > clang::clangd::doPathMapping | ( | llvm::StringRef | S, |
PathMapping::Direction | Dir, | ||
const PathMappings & | Mappings | ||
) |
Returns a modified S
with the first matching path in Mappings
substituted, if applicable.
Definition at line 20 of file PathMapping.cpp.
ASTNode clang::clangd::dumpAST | ( | const DynTypedNode & | N, |
const syntax::TokenBuffer & | Tokens, | ||
const ASTContext & | Ctx | ||
) |
Definition at line 402 of file DumpAST.cpp.
void clang::clangd::elog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 61 of file Logger.h.
References clang::clangd::Logger::Error, and clang::clangd::detail::log().
Referenced by clang::clangd::URIForFile::canonicalize(), getCorrespondingHeaderOrSource(), incomingCalls(), iterateCodepoints(), loadIndex(), clang::clangd::ClangdLSPServer::MessageHandler::onCall(), clang::clangd::ClangdLSPServer::MessageHandler::onNotify(), clang::clangd::TUScheduler::remove(), symbolToHierarchyItem(), and xpcToJson().
|
static |
Definition at line 536 of file Quality.cpp.
Referenced by sortText().
|
static |
Definition at line 1122 of file Protocol.cpp.
Referenced by toJSON().
Symbol clang::clangd::enm | ( | llvm::StringRef | Name | ) |
Definition at line 68 of file TestIndex.cpp.
Symbol clang::clangd::enmConstant | ( | llvm::StringRef | Name | ) |
Definition at line 72 of file TestIndex.cpp.
llvm::Error clang::clangd::error | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 85 of file Logger.h.
References clang::clangd::detail::error(), and clang::clangd::detail::wrap().
llvm::Error clang::clangd::error | ( | std::error_code | EC, |
const char * | Fmt, | ||
Ts &&... | Vals | ||
) |
Definition at line 79 of file Logger.h.
Referenced by clang::clangd::URI::create(), clang::clangd::remote::Marshaller::fromProtobuf(), indexToLSPLocation(), clang::clangd::URI::parse(), parsePathMappings(), positionToOffset(), clang::clangd::riff::readChunk(), clang::clangd::riff::readFile(), clang::clangd::remote::Marshaller::relativePathToURI(), clang::clangd::TestScheme::uriFromAbsolutePath(), and clang::clangd::remote::Marshaller::uriToRelativePath().
|
inline |
|
inline |
Definition at line 95 of file Logger.h.
References clang::clangd::detail::error().
void clang::clangd::escapeBackslashAndQuotes | ( | llvm::StringRef | Text, |
llvm::raw_ostream & | OS | ||
) |
Definition at line 603 of file Preamble.cpp.
DecisionForestScores clang::clangd::evaluateDecisionForest | ( | const SymbolQualitySignals & | Quality, |
const SymbolRelevanceSignals & | Relevance, | ||
float | Base | ||
) |
Definition at line 18 of file DecisionForest.cpp.
float clang::clangd::evaluateSymbolAndRelevance | ( | float | SymbolQuality, |
float | SymbolRelevance | ||
) |
Combine symbol quality and relevance into a single score.
Definition at line 530 of file Quality.cpp.
llvm::SmallVector< const NamedDecl *, 1 > clang::clangd::explicitReferenceTargets | ( | DynTypedNode | N, |
DeclRelationSet | Mask, | ||
const HeuristicResolver * | Resolver | ||
) |
Find declarations explicitly referenced in the source code defined by N
.
For templates, will prefer to return a template instantiation whenever possible. However, can also return a template pattern if the specialization cannot be picked, e.g. in dependent code or when there is no corresponding Decl for a template instantiation, e.g. for templated using decls: template <class T> using Ptr = T*; Ptr<int> x; ^~~ there is no Decl for 'Ptr<int>', so we return the template pattern. Mask
should not contain TemplatePattern or TemplateInstantiation.
Definition at line 575 of file FindTarget.cpp.
std::optional<CheapUnresolvedName> clang::clangd::extractUnresolvedNameCheaply | ( | const SourceManager & | SM, |
const DeclarationNameInfo & | Unresolved, | ||
CXXScopeSpec * | SS, | ||
const LangOptions & | LangOpts, | ||
bool | UnresolvedIsSpecifier | ||
) |
Definition at line 398 of file clangd/IncludeFixer.cpp.
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo().
std::string clang::clangd::featureString | ( | ) |
Definition at line 32 of file Feature.cpp.
Referenced by main().
|
static |
Definition at line 151 of file Background.cpp.
Referenced by clang::clangd::BackgroundIndex::boostRelated().
|
static |
Definition at line 352 of file Quality.cpp.
References clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluateHeuristics(), and operator<<().
|
static |
Fills D
with all information, except the location-related bits.
Also note that ID and Name are not part of clangd::DiagBase and should be set elsewhere.
Definition at line 654 of file Diagnostics.cpp.
|
static |
Definition at line 1718 of file XRefs.cpp.
References BaseOf, ID, Index, Object, clang::clangd::RelationsRequest::Predicate, clang::clangd::SymbolIndex::relations(), clang::clangd::RelationsRequest::Subjects, and symbolToTypeHierarchyItem().
Referenced by resolveTypeHierarchy(), and subTypes().
|
static |
Definition at line 1739 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::data, declToTypeHierarchyItem(), clang::clangd::TypeHierarchyItem::ResolveParams::parents, clang::clangd::TypeHierarchyItem::parents, and typeParents().
const NamedDecl & clang::clangd::findDecl | ( | ParsedAST & | AST, |
llvm::StringRef | QName | ||
) |
Definition at line 221 of file TestTU.cpp.
References Ctx, clang::clangd::Context::get(), clang::clangd::ParsedAST::getASTContext(), and Name.
Referenced by findUnqualifiedDecl().
const NamedDecl & clang::clangd::findDecl | ( | ParsedAST & | AST, |
std::function< bool(const NamedDecl &)> | Filter | ||
) |
Definition at line 241 of file TestTU.cpp.
std::vector< DocumentHighlight > clang::clangd::findDocumentHighlights | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Returns highlights for all usages of a symbol at Pos
.
Definition at line 1218 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findDocumentHighlights().
void clang::clangd::findExplicitReferences | ( | const ASTContext & | AST, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver | ||
) |
Definition at line 1137 of file FindTarget.cpp.
void clang::clangd::findExplicitReferences | ( | const Decl * | D, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver | ||
) |
Definition at line 1131 of file FindTarget.cpp.
void clang::clangd::findExplicitReferences | ( | const Stmt * | S, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver | ||
) |
Recursively traverse S
and report all references explicitly written in the code.
The main use-case is refactorings that need to process all references in some subrange of the file and apply simple edits, e.g. add qualifiers. FIXME: currently this does not report references to overloaded operators. FIXME: extend to report location information about declaration names too.
Definition at line 1125 of file FindTarget.cpp.
Referenced by getNonLocalDeclRefs(), and getSemanticHighlightings().
std::vector< LocatedSymbol > clang::clangd::findImplementations | ( | ParsedAST & | AST, |
Position | Pos, | ||
const SymbolIndex * | Index | ||
) |
Returns implementations at a specified Pos:
Definition at line 1259 of file XRefs.cpp.
References Index.
Referenced by clang::clangd::ClangdServer::findImplementations().
const syntax::Token * clang::clangd::findNearbyIdentifier | ( | const SpelledWord & | Word, |
const syntax::TokenBuffer & | TB | ||
) |
std::vector< const CXXRecordDecl * > clang::clangd::findRecordTypeAt | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Find the record types referenced at Pos
.
Definition at line 1770 of file XRefs.cpp.
Referenced by getTypeHierarchy().
ReferencedFiles clang::clangd::findReferencedFiles | ( | const ReferencedLocations & | Locs, |
const IncludeStructure & | Includes, | ||
const CanonicalIncludes & | CanonIncludes, | ||
const SourceManager & | SM | ||
) |
Definition at line 386 of file IncludeCleaner.cpp.
ReferencedFiles clang::clangd::findReferencedFiles | ( | const ReferencedLocations & | Locs, |
const SourceManager & | SM, | ||
llvm::function_ref< FileID(FileID)> | HeaderResponsible, | ||
llvm::function_ref< std::optional< StringRef >(FileID)> | UmbrellaHeader | ||
) |
Retrieves IDs of all files containing SourceLocations from Locs
.
The output only includes things SourceManager sees as files (not macro IDs). This can include <built-in>, <scratch space> etc that are not true files. HeaderResponsible
returns the public header that should be included given symbols from a file with the given FileID (example: public headers should be preferred to non self-contained and private headers). UmbrellaHeader
returns the public public header is responsible for providing symbols from a file with the given FileID (example: MyType.h should be included instead of MyType_impl.h).
Definition at line 347 of file IncludeCleaner.cpp.
ReferencedLocations clang::clangd::findReferencedLocations | ( | ASTContext & | Ctx, |
Preprocessor & | PP, | ||
const syntax::TokenBuffer * | Tokens | ||
) |
Finds locations of all symbols used in the main file.
Tokens
is not nullptr, we also examine all identifier tokens in the file in case they reference macros macros. We use this to compute unused headers, so we:Definition at line 330 of file IncludeCleaner.cpp.
Referenced by findReferencedLocations().
ReferencedLocations clang::clangd::findReferencedLocations | ( | ParsedAST & | AST | ) |
Definition at line 342 of file IncludeCleaner.cpp.
References findReferencedLocations(), clang::clangd::ParsedAST::getASTContext(), clang::clangd::ParsedAST::getPreprocessor(), and clang::clangd::ParsedAST::getTokens().
ReferencesResult clang::clangd::findReferences | ( | ParsedAST & | AST, |
Position | Pos, | ||
uint32_t | Limit, | ||
const SymbolIndex * | Index = nullptr , |
||
bool | AddContext = false |
||
) |
const Symbol & clang::clangd::findSymbol | ( | const SymbolSlab & | Slab, |
llvm::StringRef | QName | ||
) |
Definition at line 187 of file TestTU.cpp.
std::vector< LocatedSymbol > clang::clangd::findType | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Returns symbols for types referenced at Pos
.
For example, given b^ar()
wher bar return Foo, this function returns the definition of class Foo.
Definition at line 1995 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findType().
const NamedDecl & clang::clangd::findUnqualifiedDecl | ( | ParsedAST & | AST, |
llvm::StringRef | Name | ||
) |
Definition at line 262 of file TestTU.cpp.
References findDecl(), ID, if(), and Name.
|
static |
The functions constructs a flattened view of the DocumentSymbol hierarchy.
Used by the clients that do not support the hierarchical view.
Definition at line 906 of file ClangdLSPServer.cpp.
References C, clang::clangd::DocumentSymbol::children, clang::clangd::SymbolInformation::containerName, clang::clangd::DocumentSymbol::kind, clang::clangd::SymbolInformation::kind, clang::clangd::SymbolInformation::location, clang::clangd::DocumentSymbol::name, clang::clangd::SymbolInformation::name, clang::clangd::Location::range, clang::clangd::DocumentSymbol::range, Results, and clang::clangd::Location::uri.
std::string clang::clangd::formatDocumentation | ( | const CodeCompletionString & | CCS, |
llvm::StringRef | DocComment | ||
) |
Assembles formatted documentation for a completion result.
This includes documentation comments and other relevant information like annotations.
DocComment | is a documentation comment for the original declaration, it should be obtained via getDocComment or getParameterDocComment. |
Definition at line 245 of file CodeCompletionStrings.cpp.
std::vector< tooling::Replacement > clang::clangd::formatIncremental | ( | llvm::StringRef | Code, |
unsigned | Cursor, | ||
llvm::StringRef | InsertedText, | ||
format::FormatStyle | Style | ||
) |
Applies limited formatting around new InsertedText
.
The Code
already contains the updated text before Cursor
, and may have had additional / characters (such as indentation) inserted by the editor.
Example breaking a line (^ is the cursor): === before newline is typed === if(1){^} === after newline is typed and editor indents === if(1){ ^} === after formatIncremental(InsertedText="\n") === if (1) { ^ }
We return sorted vector<tooling::Replacement>, not tooling::Replacements! We may insert text both before and after the cursor. tooling::Replacements would merge these, and thus lose information about cursor position.
Definition at line 277 of file Format.cpp.
|
inline |
Definition at line 284 of file Protocol.h.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKind & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 966 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKindBitset & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 1000 of file Protocol.cpp.
References ns1::ns2::A, E, fromJSON(), and Out.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
FileChangeType & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 553 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolID & | S, | ||
llvm::json::Path | P | ||
) |
Definition at line 1543 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKind & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 224 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKindBitset & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 235 of file Protocol.cpp.
References ns1::ns2::A, E, fromJSON(), and Out.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TraceLevel & | Out, | ||
llvm::json::Path | P | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TypeHierarchyDirection & | Out, | ||
llvm::json::Path | P | ||
) |
Definition at line 1221 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
URIForFile & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 66 of file Protocol.cpp.
References E, clang::clangd::URIForFile::fromURI(), and clang::clangd::URI::parse().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Parameters, |
FuzzyFindRequest & | Request, | ||
llvm::json::Path | P | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ASTParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1507 of file Protocol.cpp.
References clang::clangd::ASTParams::range, and clang::clangd::ASTParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyIncomingCallsParams & | C, | ||
llvm::json::Path | P | ||
) |
Definition at line 1340 of file Protocol.cpp.
References C.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyItem & | I, | ||
llvm::json::Path | P | ||
) |
Definition at line 1327 of file Protocol.cpp.
References clang::clangd::CallHierarchyItem::data, clang::clangd::CallHierarchyItem::kind, clang::clangd::CallHierarchyItem::name, clang::clangd::CallHierarchyItem::range, clang::clangd::CallHierarchyItem::selectionRange, and clang::clangd::CallHierarchyItem::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyOutgoingCallsParams & | C, | ||
llvm::json::Path | P | ||
) |
Definition at line 1350 of file Protocol.cpp.
References C.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClangdCompileCommand & | CDbUpdate, | ||
llvm::json::Path | P | ||
) |
Definition at line 1193 of file Protocol.cpp.
References clang::clangd::ClangdCompileCommand::compilationCommand, and clang::clangd::ClangdCompileCommand::workingDirectory.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClientCapabilities & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 327 of file Protocol.cpp.
References clang::clangd::ClientCapabilities::DiagnosticCategory, clang::clangd::ClientCapabilities::DiagnosticFixes, clang::clangd::ClientCapabilities::DiagnosticRelatedInformation, Diagnostics, clang::clangd::ClientCapabilities::ReferenceContainer, References, clang::clangd::ClientCapabilities::SemanticTokens, and clang::clangd::ClientCapabilities::TheiaSemanticHighlighting.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionContext & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 672 of file Protocol.cpp.
References clang::clangd::CodeActionContext::diagnostics, and clang::clangd::CodeActionContext::only.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 703 of file Protocol.cpp.
References clang::clangd::CodeActionParams::context, clang::clangd::CodeActionParams::range, and clang::clangd::CodeActionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionContext & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 895 of file Protocol.cpp.
References clang::clangd::CompletionContext::triggerCharacter, and clang::clangd::CompletionContext::triggerKind.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 906 of file Protocol.cpp.
References clang::clangd::CompletionParams::context, fromJSON(), clang::clangd::Context::get(), and clang::clangd::CompletionParams::limit.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ConfigurationSettings & | S, | ||
llvm::json::Path | P | ||
) |
Definition at line 1200 of file Protocol.cpp.
References clang::clangd::ConfigurationSettings::compilationDatabaseChanges.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Diagnostic & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 648 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeConfigurationParams & | CCP, | ||
llvm::json::Path | P | ||
) |
Definition at line 1187 of file Protocol.cpp.
References clang::clangd::DidChangeConfigurationParams::settings.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeTextDocumentParams & | R, | ||
llvm::json::Path | P | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeWatchedFilesParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 571 of file Protocol.cpp.
References clang::clangd::DidChangeWatchedFilesParams::changes.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidCloseTextDocumentParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 532 of file Protocol.cpp.
References clang::clangd::DidCloseTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidOpenTextDocumentParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 526 of file Protocol.cpp.
References clang::clangd::DidOpenTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidSaveTextDocumentParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 538 of file Protocol.cpp.
References clang::clangd::DidSaveTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentFormattingParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 597 of file Protocol.cpp.
References clang::clangd::DocumentFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentLinkParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1457 of file Protocol.cpp.
References clang::clangd::DocumentLinkParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentOnTypeFormattingParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 590 of file Protocol.cpp.
References clang::clangd::DocumentOnTypeFormattingParams::ch, clang::clangd::DocumentOnTypeFormattingParams::position, and clang::clangd::DocumentOnTypeFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentRangeFormattingParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 584 of file Protocol.cpp.
References clang::clangd::DocumentRangeFormattingParams::range, and clang::clangd::DocumentRangeFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentSymbolParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 603 of file Protocol.cpp.
References clang::clangd::DocumentSymbolParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ExecuteCommandParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 716 of file Protocol.cpp.
References Args, clang::clangd::ExecuteCommandParams::argument, and clang::clangd::ExecuteCommandParams::command.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FileEvent & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 565 of file Protocol.cpp.
References clang::clangd::FileEvent::type, and clang::clangd::FileEvent::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FoldingRangeParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1470 of file Protocol.cpp.
References clang::clangd::FoldingRangeParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializationOptions & | Opts, | ||
llvm::json::Path | P | ||
) |
Definition at line 1209 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializeParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 462 of file Protocol.cpp.
References clang::clangd::InitializeParams::capabilities, clang::clangd::InitializeParams::initializationOptions, clang::clangd::InitializeParams::processId, clang::clangd::InitializeParams::rawCapabilities, clang::clangd::InitializeParams::rootPath, clang::clangd::InitializeParams::rootUri, and clang::clangd::InitializeParams::trace.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InlayHintsParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1360 of file Protocol.cpp.
References clang::clangd::InlayHintsParams::range, and clang::clangd::InlayHintsParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Position & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 120 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Range & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 137 of file Protocol.cpp.
References clang::clangd::Range::end, and clang::clangd::Range::start.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceContext & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1295 of file Protocol.cpp.
References clang::clangd::ReferenceContext::includeDeclaration.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1301 of file Protocol.cpp.
References Base, clang::clangd::ReferenceParams::context, and fromJSON().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
RenameParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1100 of file Protocol.cpp.
References clang::clangd::RenameParams::newName, clang::clangd::RenameParams::position, and clang::clangd::RenameParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ResolveTypeHierarchyItemParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1287 of file Protocol.cpp.
References clang::clangd::ResolveTypeHierarchyItemParams::direction, clang::clangd::ResolveTypeHierarchyItemParams::item, and clang::clangd::ResolveTypeHierarchyItemParams::resolve.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SelectionRangeParams & | S, | ||
llvm::json::Path | P | ||
) |
Definition at line 1442 of file Protocol.cpp.
References clang::clangd::SelectionRangeParams::positions, and clang::clangd::SelectionRangeParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensDeltaParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1170 of file Protocol.cpp.
References clang::clangd::SemanticTokensDeltaParams::previousResultId, and clang::clangd::SemanticTokensDeltaParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 1164 of file Protocol.cpp.
References clang::clangd::SemanticTokensParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentContentChangeEvent & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 577 of file Protocol.cpp.
References clang::clangd::TextDocumentContentChangeEvent::range, clang::clangd::TextDocumentContentChangeEvent::rangeLength, and clang::clangd::TextDocumentContentChangeEvent::text.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentIdentifier & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 101 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentItem & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 180 of file Protocol.cpp.
References clang::clangd::TextDocumentItem::languageId, clang::clangd::TextDocumentItem::text, clang::clangd::TextDocumentItem::uri, and clang::clangd::TextDocumentItem::version.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentPositionParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 888 of file Protocol.cpp.
References clang::clangd::TextDocumentPositionParams::position, and clang::clangd::TextDocumentPositionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextEdit & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 187 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TweakArgs & | A, | ||
llvm::json::Path | P | ||
) |
Definition at line 865 of file Protocol.cpp.
References ns1::ns2::A.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyItem & | I, | ||
llvm::json::Path | P | ||
) |
Definition at line 1272 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::children, clang::clangd::TypeHierarchyItem::data, clang::clangd::TypeHierarchyItem::deprecated, clang::clangd::TypeHierarchyItem::detail, clang::clangd::TypeHierarchyItem::kind, clang::clangd::TypeHierarchyItem::name, clang::clangd::TypeHierarchyItem::parents, clang::clangd::TypeHierarchyItem::range, clang::clangd::TypeHierarchyItem::selectionRange, and clang::clangd::TypeHierarchyItem::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyItem::ResolveParams & | RP, | ||
llvm::json::Path | P | ||
) |
Definition at line 1253 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::ResolveParams::parents, and clang::clangd::TypeHierarchyItem::ResolveParams::symbolID.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyPrepareParams & | R, | ||
llvm::json::Path | P | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
VersionedTextDocumentIdentifier & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 113 of file Protocol.cpp.
References fromJSON(), and clang::clangd::VersionedTextDocumentIdentifier::version.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceEdit & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 710 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changes.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceSymbolParams & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 805 of file Protocol.cpp.
References clang::clangd::WorkspaceSymbolParams::limit, and clang::clangd::WorkspaceSymbolParams::query.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Response, |
ApplyWorkspaceEditResponse & | R, | ||
llvm::json::Path | P | ||
) |
Definition at line 881 of file Protocol.cpp.
References clang::clangd::ApplyWorkspaceEditResponse::applied, and clang::clangd::ApplyWorkspaceEditResponse::failureReason.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
MarkupKind & | K, | ||
llvm::json::Path | P | ||
) |
Definition at line 926 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
OffsetEncoding & | OE, | ||
llvm::json::Path | P | ||
) |
Definition at line 1426 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const TypeHierarchyItem::ResolveParams & | ) |
Symbol clang::clangd::func | ( | llvm::StringRef | Name | ) |
Definition at line 60 of file TestIndex.cpp.
SymbolSlab clang::clangd::generateNumSymbols | ( | int | Begin, |
int | End | ||
) |
Definition at line 122 of file TestIndex.cpp.
SymbolSlab clang::clangd::generateSymbols | ( | std::vector< std::string > | QualifiedNames | ) |
Definition at line 115 of file TestIndex.cpp.
References clang::clangd::SymbolSlab::Builder::insert(), and symbol().
std::vector< const Attr * > clang::clangd::getAttributes | ( | const DynTypedNode & | N | ) |
std::optional<llvm::StringRef> clang::clangd::getBacktickQuoteRange | ( | llvm::StringRef | Line, |
unsigned | Offset | ||
) |
Definition at line 1313 of file Hover.cpp.
Referenced by parseDocumentationLine().
std::optional< std::string > clang::clangd::getCanonicalPath | ( | const FileEntry * | F, |
const SourceManager & | SourceMgr | ||
) |
Get the canonical path of F
.
This means:
This function should be used when paths needs to be used outside the component that generate it, so that paths are normalized as much as possible.
Definition at line 515 of file SourceCode.cpp.
Referenced by findInputFile(), and clang::clangd::SymbolCollector::HeaderFileURICache::toURI().
TemplateTypeParmTypeLoc clang::clangd::getContainedAutoParamType | ( | TypeLoc | TL | ) |
std::optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | PathRef | OriginalFile, |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS | ||
) |
Given a header file, returns the best matching source file, and vice visa.
It only uses the filename heuristics to do the inference.
Definition at line 21 of file HeaderSourceSwitch.cpp.
Referenced by clang::clangd::ClangdServer::switchSourceHeader().
std::optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | PathRef | OriginalFile, |
ParsedAST & | AST, | ||
const SymbolIndex * | Index | ||
) |
Given a header file, returns the best matching source file, and vice visa.
The heuristics incorporate with the AST and the index (if provided).
Definition at line 67 of file HeaderSourceSwitch.cpp.
References clang::clangd::Symbol::CanonicalDeclaration, ns1::ns2::D, clang::clangd::Symbol::Definition, elog(), clang::clangd::SymbolLocation::FileURI, getIndexableLocalDecls(), clang::clangd::ParsedAST::getLangOpts(), getSymbolID(), ID, clang::clangd::LookupRequest::IDs, Index, isHeaderFile(), clang::clangd::SymbolIndex::lookup(), pathEqual(), and clang::clangd::URI::resolve().
const ObjCImplDecl * clang::clangd::getCorrespondingObjCImpl | ( | const ObjCContainerDecl * | D | ) |
Return the corresponding implementation/definition for the given ObjC container if it has one, otherwise, return nullptr.
Objective-C classes can have three types of declarations:
Objective-C categories are extensions on classes:
With one special case, a class extension, which is normally used to keep some declarations internal to a file without exposing them in a header.
For Objective-C protocols, e.g. "@protocol MyProtocol ... @end" this will return nullptr as protocols don't have an implementation.
Definition at line 365 of file AST.cpp.
References ns1::ns2::D, and ID.
std::string clang::clangd::getDeclComment | ( | const ASTContext & | Ctx, |
const NamedDecl & | Decl | ||
) |
Similar to getDocComment, but returns the comment for a NamedDecl.
Definition at line 73 of file CodeCompletionStrings.cpp.
std::optional< QualType > clang::clangd::getDeducedType | ( | ASTContext & | , |
SourceLocation | Loc | ||
) |
Retrieves the deduced type at a given location (auto, decltype).
It will return the underlying type. If the type is an undeduced auto, returns the type itself.
Definition at line 598 of file AST.cpp.
Referenced by typeForNode().
unsigned clang::clangd::getDefaultAsyncThreadsCount | ( | ) |
Returns a number of a default async threads to use for TUScheduler.
Returned value is always >= 1 (i.e. will not cause requests to be processed synchronously).
Definition at line 1589 of file TUScheduler.cpp.
std::optional< std::string > clang::clangd::getDiagnosticDocURI | ( | Diag::DiagSource | Source, |
unsigned | ID, | ||
llvm::StringRef | Name | ||
) |
Returns a URI providing more information about a particular diagnostic.
Definition at line 911 of file Diagnostics.cpp.
std::string clang::clangd::getDocComment | ( | const ASTContext & | Ctx, |
const CodeCompletionResult & | Result, | ||
bool | CommentsFromHeaders | ||
) |
Gets a minimally formatted documentation comment of Result
, with comment markers stripped.
See clang::RawComment::getFormattedText() for the detailed explanation of how the comment text is transformed. Returns empty string when no comment is available. If CommentsFromHeaders
parameter is set, only comments from the main file will be returned. It is used to workaround crashes when parsing comments in the stale headers, coming from completion preamble.
Definition at line 61 of file CodeCompletionStrings.cpp.
std::vector< DocumentLink > clang::clangd::getDocumentLinks | ( | ParsedAST & | AST | ) |
Get all document links.
Definition at line 826 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::documentLinks().
llvm::Expected< std::vector< DocumentSymbol > > clang::clangd::getDocumentSymbols | ( | ParsedAST & | AST | ) |
Retrieves the symbols contained in the "main file" section of an AST in the same order that they appear.
Definition at line 653 of file FindSymbols.cpp.
Referenced by clang::clangd::ClangdServer::documentSymbols().
EligibleRegion clang::clangd::getEligiblePoints | ( | llvm::StringRef | Code, |
llvm::StringRef | FullyQualifiedName, | ||
const LangOptions & | LangOpts | ||
) |
Returns most eligible region to insert a definition for FullyQualifiedName
in the Code
.
Pseudo parses \pCode under the hood to determine namespace decls and possible insertion points. Choses the region that matches the longest prefix of FullyQualifiedName
. Returns EOF if there are no shared namespaces. FullyQualifiedName
should not contain anonymous namespaces.
Definition at line 1145 of file SourceCode.cpp.
References Code, clang::clangd::EligibleRegion::EligiblePoints, clang::clangd::EligibleRegion::EnclosingNamespace, if(), LangOpts, and offsetToPosition().
|
static |
Definition at line 373 of file SourceCode.cpp.
llvm::Expected< std::vector< FoldingRange > > clang::clangd::getFoldingRanges | ( | const std::string & | Code, |
bool | LineFoldingOnly | ||
) |
Returns a list of ranges whose contents might be collapsible in an editor.
This version uses the pseudoparser which does not require the AST.
Definition at line 183 of file SemanticSelection.cpp.
llvm::Expected< std::vector< FoldingRange > > clang::clangd::getFoldingRanges | ( | ParsedAST & | AST | ) |
Returns a list of ranges whose contents might be collapsible in an editor.
This should include large scopes, preprocessor blocks etc.
Definition at line 170 of file SemanticSelection.cpp.
References ns1::ns2::A, Arena, clang::clangd::ParsedAST::getASTContext(), clang::clangd::ParsedAST::getLangOpts(), clang::clangd::ParsedAST::getSourceManager(), and clang::clangd::ParsedAST::getTokens().
Referenced by clang::clangd::ClangdServer::foldingRanges().
format::FormatStyle clang::clangd::getFormatStyleForFile | ( | llvm::StringRef | File, |
llvm::StringRef | Content, | ||
const ThreadsafeFS & | TFS | ||
) |
Choose the clang-format style we should apply to a certain file.
This will usually use FS to look for .clang-format directories. FIXME: should we be caching the .clang-format file search? This uses format::DefaultFormatStyle and format::DefaultFallbackStyle, though the latter may have been overridden in main()!
Definition at line 581 of file SourceCode.cpp.
std::optional< HoverInfo > clang::clangd::getHover | ( | ParsedAST & | AST, |
Position | Pos, | ||
const format::FormatStyle & | Style, | ||
const SymbolIndex * | Index | ||
) |
Returns all indexable decls that are present in the main file of the AST.
Exposed for unittests.
Definition at line 122 of file HeaderSourceSwitch.cpp.
References ns1::ns2::D, Decl, clang::clangd::ParsedAST::getLocalTopLevelDecls(), Results, and clang::clangd::SymbolCollector::shouldCollectSymbol().
Referenced by getCorrespondingHeaderOrSource().
|
static |
Definition at line 305 of file SourceCode.cpp.
|
static |
Definition at line 297 of file SourceCode.cpp.
std::optional< std::vector< Range > > clang::clangd::getMappedRanges | ( | ArrayRef< Range > | Indexed, |
ArrayRef< Range > | Lexed | ||
) |
Calculates the lexed occurrences that the given indexed occurrences map to.
Returns std::nullopt if we don't find a mapping.
Exposed for testing only.
REQUIRED: Indexed and Lexed are sorted.
Definition at line 926 of file Rename.cpp.
References renameRangeAdjustmentCost(), SPAN_ATTACH, Tracer, and vlog().
Referenced by adjustRenameRanges().
|
static |
llvm::DenseSet< const Decl * > clang::clangd::getNonLocalDeclRefs | ( | ParsedAST & | AST, |
const FunctionDecl * | FD | ||
) |
Returns all decls that are referenced in the FD
except local symbols.
Definition at line 2236 of file XRefs.cpp.
References ns1::ns2::D, Decl, findExplicitReferences(), and clang::clangd::ParsedAST::getHeuristicResolver().
NamedDecl * clang::clangd::getOnlyInstantiation | ( | NamedDecl * | TemplatedDecl | ) |
Definition at line 635 of file AST.cpp.
References getOnlyInstantiationImpl().
|
static |
Definition at line 623 of file AST.cpp.
Referenced by getOnlyInstantiation().
std::string clang::clangd::getQualification | ( | ASTContext & | Context, |
const DeclContext * | DestContext, | ||
const NamedDecl * | ND, | ||
llvm::ArrayRef< std::string > | VisibleNamespaces | ||
) |
This function uses the VisibleNamespaces
to figure out if a shorter qualification is sufficient for ND
, and ignores any using namespace directives.
It can be useful if there's no AST for the DestContext, but some pseudo-parsing is done. i.e. if ND
is ns1::ns2::X and DestContext
is ns1::, users can provide ns2::
as visible to change the result to be empty. Elements in VisibleNamespaces should be in the form: ns::
, with trailing "::". Note that this is just textual and might be incorrect. e.g. when there are two namespaces ns1::a and ns2::a, the function will early exit if "a::" is present in VisibleNamespaces
, no matter whether it is from ns1:: or ns2::
std::string clang::clangd::getQualification | ( | ASTContext & | Context, |
const DeclContext * | DestContext, | ||
SourceLocation | InsertionPoint, | ||
const NamedDecl * | ND | ||
) |
Gets the nested name specifier necessary for spelling ND
in DestContext
, at InsertionPoint
.
It selects the shortest suffix of ND
such that it is visible in DestContext
. Returns an empty string if no qualification is necessary. For example, if you want to qualify clang::clangd::bar::foo in clang::clangd::x, this function will return bar. Note that the result might be sub-optimal for classes, e.g. when the ND
is a member of the base class.
This version considers all the using namespace directives before InsertionPoint
. i.e, if you have using namespace clang::clangd::bar
, this function will return an empty string for the example above since no qualification is necessary in that case. FIXME: Also take using directives and namespace aliases inside function body into account.
std::string clang::clangd::getQualifiedName | ( | const Symbol & | Sym | ) |
Definition at line 129 of file TestIndex.cpp.
References clang::clangd::Symbol::Name, clang::clangd::Symbol::Scope, and clang::clangd::Symbol::TemplateSpecializationArgs.
Referenced by lookup().
NestedNameSpecifierLoc clang::clangd::getQualifierLoc | ( | const NamedDecl & | ND | ) |
Returns a nested name specifier loc of ND
if it was present in the source, e.g.
void ns::something::foo() -> returns 'ns::something' void foo() -> returns null
Definition at line 204 of file AST.cpp.
Referenced by printName().
llvm::SmallVector< SymbolInclude, 1 > clang::clangd::getRankedIncludes | ( | const Symbol & | Sym | ) |
Definition at line 215 of file Headers.cpp.
RefSlab clang::clangd::getRefs | ( | const SymbolIndex & | Index, |
SymbolID | ID | ||
) |
Definition at line 138 of file SyncAPI.cpp.
References ID, clang::clangd::RefsRequest::IDs, Index, clang::clangd::RefSlab::Builder::insert(), and clang::clangd::SymbolIndex::refs().
std::string clang::clangd::getReturnType | ( | const CodeCompletionString & | CCS | ) |
Gets detail to be used as the detail field in an LSP completion item.
This is usually the return type of a function.
Definition at line 275 of file CodeCompletionStrings.cpp.
std::vector< HighlightingToken > clang::clangd::getSemanticHighlightings | ( | ParsedAST & | AST | ) |
Definition at line 962 of file SemanticHighlighting.cpp.
References Builder, C, Decl, findExplicitReferences(), clang::clangd::ParsedAST::getASTContext(), if(), and clang::clangd::ReferenceLoc::Targets.
Referenced by clang::clangd::ClangdServer::semanticHighlights().
llvm::Expected< SelectionRange > clang::clangd::getSemanticRanges | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Returns the list of all interesting ranges around the Position Pos
.
The interesting ranges corresponds to the AST nodes in the SelectionTree containing Pos
. If pos is not in any interesting range, return [Pos, Pos).
Definition at line 112 of file SemanticSelection.cpp.
int clang::clangd::getSeverity | ( | DiagnosticsEngine::Level | L | ) |
Convert from clang diagnostic level to LSP severity.
Definition at line 551 of file Diagnostics.cpp.
void clang::clangd::getSignature | ( | const CodeCompletionString & | CCS, |
std::string * | Signature, | ||
std::string * | Snippet, | ||
std::string * | RequiredQualifiers = nullptr , |
||
bool | CompletingPattern = false |
||
) |
Formats the signature for an item, as a display string and snippet.
e.g. for const_reference std::vector<T>::at(size_type) const, this returns: *Signature = "(size_type) const" *Snippet = "(${1:size_type})" If set, RequiredQualifiers is the text that must be typed before the name. e.g "Base::" when calling a base class member function that's hidden.
When CompletingPattern
is true, the last placeholder will be of the form ${0:…}, indicating the cursor should stay there.
Definition at line 97 of file CodeCompletionStrings.cpp.
std::optional<std::string> clang::clangd::getSpelledSpecifier | ( | const CXXScopeSpec & | SS, |
const SourceManager & | SM | ||
) |
Definition at line 384 of file clangd/IncludeFixer.cpp.
llvm::StringRef clang::clangd::getStdlibUmbrellaHeader | ( | const LangOptions & | LO | ) |
Definition at line 97 of file StdLib.cpp.
Gets the symbol ID for a declaration. Returned SymbolID might be null.
Definition at line 348 of file AST.cpp.
References ns1::ns2::D, and USR.
Referenced by clang::clangd::SymbolRelevanceSignals::computeASTSignals(), and getCorrespondingHeaderOrSource().
SymbolID clang::clangd::getSymbolID | ( | const llvm::StringRef | MacroName, |
const MacroInfo * | MI, | ||
const SourceManager & | SM | ||
) |
Gets the symbol ID for a macro.
Returned SymbolID might be null. Currently, this is an encoded USR of the macro, which incorporates macro locations (e.g. file name, offset in file). FIXME: the USR semantics might not be stable enough as the ID for index macro (e.g. a change in definition offset can result in a different USR). We could change these semantics in the future by reimplementing this funcure (e.g. avoid USR for macros).
std::vector< SymbolDetails > clang::clangd::getSymbolInfo | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Get info about symbols at Pos
.
Definition at line 1527 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::symbolInfo().
SystemIncludeExtractorFn clang::clangd::getSystemIncludeExtractor | ( | llvm::ArrayRef< std::string > | QueryDriverGlobs | ) |
Definition at line 370 of file SystemIncludeExtractor.cpp.
tidy::ClangTidyOptions clang::clangd::getTidyOptionsForFile | ( | TidyProviderRef | Provider, |
llvm::StringRef | Filename | ||
) |
Definition at line 284 of file TidyProvider.cpp.
|
static |
Definition at l