clang-tools
11.0.0
|
Namespaces | |
config | |
detail | |
dex | |
markup | |
remote | |
riff | |
trace | |
Classes | |
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 | ASTRetentionPolicy |
Configuration of the AST retention policy. 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 |
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 |
class | CollectMainFileMacros |
Collects macro references (e.g. More... | |
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... | |
class | DeclRelationSet |
struct | DefinedMacro |
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... | |
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 |
Exact commands are not specified in the protocol so we define the ones supported by Clangd here. 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... | |
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 | InputsAndAST |
struct | InputsAndPreamble |
class | Key |
Values in a Context are indexed by typed keys. More... | |
struct | LineHighlightings |
Contains all information about highlightings on a single line. 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 | LSPClient |
struct | LSPDiagnosticCompare |
A LSP-specific comparator used to find diagnostic in a container like std:map. More... | |
class | LSPError |
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 |
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 | PolySubsequenceMatcher |
struct | Position |
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... | |
struct | ProgressParams |
struct | ProjectInfo |
struct | PublishDiagnosticsParams |
struct | Range |
class | RealThreadsafeFS |
struct | Ref |
Represents a symbol occurrence in the source file. More... | |
struct | ReferenceLoc |
Information about a reference written in the source code, independent of the actual AST node that this reference lives in. 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 | 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 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 |
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 |
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 |
struct | TextDocumentContentChangeEvent |
struct | TextDocumentIdentifier |
struct | TextDocumentItem |
struct | TextDocumentPositionParams |
struct | TextEdit |
struct | TheiaSemanticHighlightingInformation |
Represents a semantic highlighting information that has to be applied on a specific line of the text document. More... | |
struct | TheiaSemanticHighlightingParams |
Parameters for the semantic highlighting (server-side) push notification. 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 | 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 | TypeHierarchyParams |
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 | ClangTidyOptionsBuilder = std::function< tidy::ClangTidyOptions(llvm::vfs::FileSystem &, llvm::StringRef)> |
When set, used by ClangdServer to get clang-tidy options for each particular file. More... | |
using | CharTypeSet = unsigned char |
using | IncludeGraph = llvm::StringMap< IncludeGraphNode > |
using | SlabTuple = std::tuple< SymbolSlab, RefSlab, RelationSlab > |
using | PathMappings = std::vector< PathMapping > |
using | PreambleParsedCallback = std::function< void(ASTContext &, std::shared_ptr< clang::Preprocessor >, const CanonicalIncludes &)> |
using | InitializedParams = NoParams |
using | ShutdownParams = NoParams |
using | ExitParams = NoParams |
using | CompletionItemKindBitset = std::bitset< CompletionItemKindMax+1 > |
using | SymbolKindBitset = std::bitset< SymbolKindMax+1 > |
using | DirtyBufferGetter = llvm::function_ref< llvm::Optional< std::string >(PathRef AbsPath)> |
Gets dirty buffer for a given file AbsPath . More... | |
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 | 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... | |
llvm::Optional< SymbolID > | getSymbolID (const Decl *D) |
Gets the symbol ID for a declaration, if possible. More... | |
llvm::Optional< SymbolID > | getSymbolID (const llvm::StringRef MacroName, const MacroInfo *MI, const SourceManager &SM) |
Gets the symbol ID for a macro, if possible. More... | |
std::string | printType (const QualType QT, const DeclContext &CurContext) |
Returns a QualType as string. More... | |
QualType | declaredType (const TypeDecl *D) |
llvm::Optional< QualType > | getDeducedType (ASTContext &, SourceLocation Loc) |
Retrieves the deduced type at a given location (auto, decltype). 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... | |
static std::vector< llvm::StringRef > | semanticTokenTypes () |
static std::vector< SymbolInformation > | flattenSymbolHierarchy (llvm::ArrayRef< DocumentSymbol > Symbols, const URIForFile &FileURI) |
The functions constructs a flattened view of the DocumentSymbol hierarchy. More... | |
static llvm::Optional< Command > | asCommand (const CodeAction &Action) |
static Location * | getToggle (const TextDocumentPositionParams &Point, LocatedSymbol &Sym) |
static void | increment (std::string &S) |
static llvm::Expected< std::vector< std::unique_ptr< Tweak::Selection > > > | tweakSelection (const Range &Sel, const InputsAndAST &AST) |
CompletionPrefix | guessCompletionPrefix (llvm::StringRef Content, unsigned Offset) |
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) |
Get signature help at a specified Pos in FileName . More... | |
bool | isIndexedForCodeCompletion (const NamedDecl &ND, ASTContext &ASTCtx) |
static MarkupContent | renderDoc (const markup::Document &Doc, MarkupKind Kind) |
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< 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... | |
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... | |
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... | |
static void | updateVersion (DraftStore::Draft &D, llvm::Optional< int64_t > Version) |
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 ast_type_traits::DynTypedNode &) |
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 ast_type_traits::DynTypedNode &, DeclRelationSet Mask) |
targetDecl() finds the declaration referred to by an AST node. More... | |
llvm::SmallVector< const NamedDecl *, 1 > | explicitReferenceTargets (DynTypedNode N, DeclRelationSet Mask) |
void | findExplicitReferences (const Stmt *S, llvm::function_ref< void(ReferenceLoc)> Out) |
Recursively traverse S and report all references explicitly written in the code. More... | |
void | findExplicitReferences (const Decl *D, llvm::function_ref< void(ReferenceLoc)> Out) |
void | findExplicitReferences (const ASTContext &AST, llvm::function_ref< void(ReferenceLoc)> Out) |
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) |
llvm::SmallVector< const NamedDecl *, 1 > | explicitReferenceTargets (ast_type_traits::DynTypedNode N, DeclRelationSet Mask) |
Find declarations explicitly referenced in the source code defined by N . More... | |
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::string | maybeCaseFoldPath (PathRef Path) |
static bool | pathEqual (PathRef A, PathRef B) |
std::unique_ptr< GlobalCompilationDatabase > | getQueryDriverDatabase (llvm::ArrayRef< std::string > QueryDriverGlobs, std::unique_ptr< GlobalCompilationDatabase > Base) |
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags. More... | |
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< llvm::StringRef, 1 > | getRankedIncludes (const Symbol &Sym) |
std::unique_ptr< PPCallbacks > | collectIncludeStructureCallback (const SourceManager &SM, IncludeStructure *Out) |
Returns a PPCallback that visits all inclusions in the main file. More... | |
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) |
llvm::Optional< Path > | getCorrespondingHeaderOrSource (const Path &OriginalFile, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS) |
Given a header file, returns the best matching source file, and vice visa. More... | |
llvm::Optional< Path > | getCorrespondingHeaderOrSource (const Path &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... | |
llvm::Optional< HoverInfo > | getHover (ParsedAST &AST, Position Pos, format::FormatStyle Style, const SymbolIndex *Index) |
Get the hover information when hovering at Pos . More... | |
llvm::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::Param &P) |
bool | operator== (const HoverInfo::PassType &LHS, const HoverInfo::PassType &RHS) |
bool | operator== (const HoverInfo::Param &LHS, const HoverInfo::Param &RHS) |
llvm::Optional< std::string > | qualifiedByUnresolved (const SourceManager &SM, SourceLocation Loc, const LangOptions &LangOpts) |
llvm::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, std::shared_ptr< 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::Value | toJSON (const FuzzyFindRequest &Request) |
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) |
bool | prefer (const SymbolLocation &L, const SymbolLocation &R) |
Symbol | mergeSymbol (const Symbol &L, const Symbol &R) |
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) |
void | writeYAML (const IndexFileOut &, llvm::raw_ostream &) |
llvm::Expected< IndexFileIn > | readYAML (llvm::StringRef) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const IndexFileOut &O) |
llvm::Expected< IndexFileIn > | readIndexFile (llvm::StringRef Data) |
std::unique_ptr< SymbolIndex > | loadIndex (llvm::StringRef SymbolFilename, 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::Expected< clangd::Symbol > | symbolFromYAML (StringRef YAML, llvm::UniqueStringSaver *Strings) |
llvm::Expected< clangd::Ref > | refFromYAML (StringRef YAML, llvm::UniqueStringSaver *Strings) |
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) |
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... | |
static bool | isIf (llvm::StringRef Line) |
static bool | isErrorAboutInclude (llvm::StringRef Line) |
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::unique_ptr< Transport > | newJSONTransport (std::FILE *In, llvm::raw_ostream &Out, llvm::raw_ostream *InMirror, bool Pretty, JSONStreamStyle Style) |
void | dumpAST (ParsedAST &AST, llvm::raw_ostream &OS) |
For testing/debugging purposes. More... | |
llvm::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) |
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::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::Value | toJSON (const VersionedTextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, VersionedTextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, Position &R) |
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::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) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentItem &R) |
bool | fromJSON (const llvm::json::Value &Params, TextEdit &R) |
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) |
bool | fromJSON (const llvm::json::Value &E, SymbolKind &Out) |
bool | fromJSON (const llvm::json::Value &E, SymbolKindBitset &Out) |
SymbolKind | adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds) |
SymbolKind | indexSymbolKindToSymbolKind (index::SymbolKind Kind) |
bool | fromJSON (const llvm::json::Value &Params, ClientCapabilities &R) |
bool | fromJSON (const llvm::json::Value &Params, InitializeParams &R) |
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) |
bool | fromJSON (const llvm::json::Value &Params, DidCloseTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidSaveTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &E, FileChangeType &Out) |
bool | fromJSON (const llvm::json::Value &Params, FileEvent &R) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeWatchedFilesParams &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentContentChangeEvent &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentRangeFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentOnTypeFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentSymbolParams &R) |
llvm::json::Value | toJSON (const DiagnosticRelatedInformation &DRI) |
llvm::json::Value | toJSON (const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, Diagnostic &R) |
llvm::json::Value | toJSON (const PublishDiagnosticsParams &PDP) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionContext &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionParams &R) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceEdit &R) |
bool | fromJSON (const llvm::json::Value &Params, ExecuteCommandParams &R) |
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::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::Value | toJSON (const TweakArgs &A) |
llvm::json::Value | toJSON (const ApplyWorkspaceEditParams &Params) |
bool | fromJSON (const llvm::json::Value &Response, ApplyWorkspaceEditResponse &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentPositionParams &R) |
bool | fromJSON (const llvm::json::Value &Params, CompletionContext &R) |
bool | fromJSON (const llvm::json::Value &Params, CompletionParams &R) |
static llvm::StringRef | toTextKind (MarkupKind Kind) |
bool | fromJSON (const llvm::json::Value &V, MarkupKind &K) |
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) |
CompletionItemKind | adjustKindToCapability (CompletionItemKind Kind, CompletionItemKindBitset &SupportedCompletionItemKinds) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKindBitset &Out) |
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::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) |
bool | fromJSON (const llvm::json::Value &Params, SemanticTokensDeltaParams &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentHighlight &V) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeConfigurationParams &CCP) |
bool | fromJSON (const llvm::json::Value &Params, ClangdCompileCommand &CDbUpdate) |
bool | fromJSON (const llvm::json::Value &Params, ConfigurationSettings &S) |
bool | fromJSON (const llvm::json::Value &Params, InitializationOptions &Opts) |
bool | fromJSON (const llvm::json::Value &E, TypeHierarchyDirection &Out) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyParams &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const TypeHierarchyItem &I) |
llvm::json::Value | toJSON (const TypeHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, ResolveTypeHierarchyItemParams &P) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceParams &R) |
static const char * | toString (OffsetEncoding OE) |
llvm::json::Value | toJSON (const OffsetEncoding &OE) |
bool | fromJSON (const llvm::json::Value &V, OffsetEncoding &OE) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, OffsetEncoding Enc) |
bool | operator== (const TheiaSemanticHighlightingInformation &Lhs, const TheiaSemanticHighlightingInformation &Rhs) |
llvm::json::Value | toJSON (const TheiaSemanticHighlightingInformation &Highlighting) |
llvm::json::Value | toJSON (const TheiaSemanticHighlightingParams &Highlighting) |
bool | fromJSON (const llvm::json::Value &Params, SelectionRangeParams &P) |
llvm::json::Value | toJSON (const SelectionRange &Out) |
bool | fromJSON (const llvm::json::Value &Params, DocumentLinkParams &R) |
llvm::json::Value | toJSON (const DocumentLink &DocumentLink) |
bool | fromJSON (const llvm::json::Value &Params, FoldingRangeParams &R) |
llvm::json::Value | toJSON (const FoldingRange &Range) |
bool | operator== (const TextEdit &L, const TextEdit &R) |
bool | fromJSON (const llvm::json::Value &, NoParams &) |
template<typename T > | |
llvm::json::Value | toJSON (const ProgressParams< T > &P) |
static bool | isReserved (llvm::StringRef Name) |
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 std::pair< float, unsigned > | uriProximity (llvm::StringRef SymbolURI, URIDistance *D) |
static float | scopeBoost (ScopeDistance &Distance, llvm::Optional< llvm::StringRef > SymbolScope) |
static llvm::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) |
llvm::Expected< FileEdits > | 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... | |
llvm::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... | |
llvm::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) |
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) |
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) |
std::vector< LineHighlightings > | diffHighlightings (ArrayRef< HighlightingToken > New, ArrayRef< HighlightingToken > Old) |
Return a line-by-line diff between two highlightings. More... | |
bool | operator== (const HighlightingToken &L, const HighlightingToken &R) |
bool | operator< (const HighlightingToken &L, const HighlightingToken &R) |
bool | operator== (const LineHighlightings &L, const LineHighlightings &R) |
std::vector< SemanticToken > | toSemanticTokens (llvm::ArrayRef< HighlightingToken > Tokens) |
llvm::StringRef | toSemanticTokenType (HighlightingKind Kind) |
std::vector< TheiaSemanticHighlightingInformation > | toTheiaSemanticHighlightingInformation (llvm::ArrayRef< LineHighlightings > Tokens) |
Convert to LSP's semantic highlighting information. More... | |
llvm::StringRef | toTextMateScope (HighlightingKind Kind) |
Converts a HighlightingKind to a corresponding TextMate scope (https://manual.macromates.com/en/language_grammars). More... | |
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... | |
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... | |
llvm::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) |
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) |
llvm::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) |
llvm::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... | |
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) |
llvm::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... | |
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, llvm::Optional< LangOptions > LangOpts=llvm::None) |
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) |
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) |
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 (llvm::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 > | |
LLVM_NODISCARD 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... | |
unsigned | getDefaultAsyncThreadsCount () |
Returns a number of a default async threads to use for TUScheduler. More... | |
static clangd::Range | toLSPRange (llvm::StringRef Code, 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, 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 (BackgroundIndexRebuilderTest, IndexingTUs) | |
TEST_F (BackgroundIndexRebuilderTest, LoadingShards) | |
TEST (BackgroundQueueTest, Priority) | |
TEST (BackgroundQueueTest, Boost) | |
TEST (BackgroundQueueTest, Progress) | |
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) |
TEST (ContextTests, Simple) | |
TEST (ContextTests, MoveOps) | |
TEST (ContextTests, Builders) | |
TEST_F (ThreadingTest, TaskRunner) | |
TEST_F (ThreadingTest, Memoize) | |
TEST_F (ThreadingTest, MemoizeDeterministic) | |
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) |
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< FileEdits > | runRename (ClangdServer &Server, PathRef File, Position Pos, llvm::StringRef NewName, const RenameOptions &RenameOpts) |
llvm::Expected< tooling::Replacements > | runFormatFile (ClangdServer &Server, PathRef File, StringRef Code) |
std::string | runDumpAST (ClangdServer &Server, PathRef File) |
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< llvm::Optional< clangd::Path > > | runSwitchHeaderSource (ClangdServer &Server, PathRef File) |
void | runAddDocument (ClangdServer &Server, PathRef File, StringRef Contents, StringRef Version="null", WantDiagnostics WantDiags=WantDiagnostics::Auto, bool ForceRebuild=false) |
llvm::Expected< FileEdits > | 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 | var (llvm::StringRef Name) |
Symbol | ns (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) |
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) |
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, const std::string &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... | |
ReferencesResult | findReferences (ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index=nullptr) |
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) |
static llvm::Optional< TypeHierarchyItem > | declToTypeHierarchyItem (ASTContext &Ctx, const NamedDecl &ND, const syntax::TokenBuffer &TB) |
static Optional< TypeHierarchyItem > | symbolToTypeHierarchyItem (const Symbol &S, const SymbolIndex *Index, 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, ASTContext &ASTCtx, std::vector< TypeHierarchyItem > &SuperTypes, RecursionProtectionSet &RPSet, const syntax::TokenBuffer &TB) |
const CXXRecordDecl * | findRecordTypeAt (ParsedAST &AST, Position Pos) |
Find the record type references at Pos . More... | |
std::vector< const CXXRecordDecl * > | typeParents (const CXXRecordDecl *CXXRD) |
Given a record type declaration, find its base (parent) types. More... | |
llvm::Optional< TypeHierarchyItem > | getTypeHierarchy (ParsedAST &AST, Position Pos, int Resolve, TypeHierarchyDirection Direction, const SymbolIndex *Index=nullptr, PathRef TUPath=PathRef{}) |
Get type hierarchy information at Pos . More... | |
void | resolveTypeHierarchy (TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, 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 constexpr int | AwfulScore = -(1 << 13) |
static constexpr int | PerfectBonus = 4 |
constexpr static uint8_t | CharTypes [] |
constexpr static uint8_t | CharRoles [] |
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 std::atomic< bool > | ShutdownRequested = {false} |
static clang::clangd::Key< std::string > | kFileBeingProcessed |
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::ClangTidyOptionsBuilder = typedef std::function<tidy::ClangTidyOptions( llvm::vfs::FileSystem &, llvm::StringRef )> |
When set, used by ClangdServer to get clang-tidy options for each particular file.
Must be thread-safe. We use this instead of ClangTidyOptionsProvider to allow reading tidy configs from the VFS used for parsing.
Definition at line 48 of file ClangdServer.h.
using clang::clangd::CompletionItemKindBitset = typedef std::bitset<CompletionItemKindMax + 1> |
Definition at line 314 of file Protocol.h.
using clang::clangd::DirtyBufferGetter = typedef llvm::function_ref<llvm::Optional<std::string>(PathRef AbsPath)> |
using clang::clangd::ExitParams = typedef NoParams |
Definition at line 264 of file Protocol.h.
using clang::clangd::FileDigest = typedef std::array<uint8_t, 8> |
Definition at line 40 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 198 of file SourceCode.h.
using clang::clangd::IncludeGraph = typedef llvm::StringMap<IncludeGraphNode> |
using clang::clangd::InitializedParams = typedef NoParams |
Definition at line 262 of file Protocol.h.
using clang::clangd::Obj = typedef llvm::json::Object |
Definition at line 164 of file LSPClient.cpp.
using clang::clangd::Path = typedef std::string |
using clang::clangd::PathMappings = typedef std::vector<PathMapping> |
Definition at line 38 of file PathMapping.h.
using clang::clangd::PathRef = typedef llvm::StringRef |
using clang::clangd::PreambleParsedCallback = typedef std::function<void(ASTContext &, std::shared_ptr<clang::Preprocessor>, const CanonicalIncludes &)> |
Definition at line 76 of file Preamble.h.
using clang::clangd::RecursionProtectionSet = typedef llvm::SmallSet<const CXXRecordDecl *, 4> |
using clang::clangd::ShutdownParams = typedef NoParams |
Definition at line 263 of file Protocol.h.
using clang::clangd::SlabTuple = typedef std::tuple<SymbolSlab, RefSlab, RelationSlab> |
Definition at line 150 of file FileIndex.h.
using clang::clangd::SymbolKindBitset = typedef std::bitset<SymbolKindMax + 1> |
Definition at line 352 of file Protocol.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 281 of file Protocol.h.
|
strong |
Definition at line 1039 of file Protocol.h.
|
strong |
Definition at line 93 of file FindTarget.h.
|
strong |
Enumerator | |
---|---|
Text | |
Read | |
Write |
Definition at line 1242 of file Protocol.h.
|
strong |
How to handle duplicated symbols across multiple files.
Enumerator | |
---|---|
PickOne | |
Merge |
Definition at line 51 of file FileIndex.h.
|
strong |
Enumerator | |
---|---|
ParseError | |
InvalidRequest | |
MethodNotFound | |
InvalidParams | |
InternalError | |
ServerNotInitialized | |
UnknownErrorCode | |
RequestCancelled | |
ContentModified |
Definition at line 40 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Created | The file got created. |
Changed | The file got changed. |
Deleted | The file got deleted. |
Definition at line 702 of file Protocol.h.
|
strong |
Definition at line 40 of file SemanticHighlighting.h.
|
strong |
Enumerator | |
---|---|
RIFF | |
YAML |
Definition at line 36 of file Serialization.h.
|
strong |
Select between in-memory index implementations, which have tradeoffs.
Enumerator | |
---|---|
Light | |
Heavy |
Definition at line 43 of file FileIndex.h.
|
strong |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Definition at line 1082 of file Protocol.h.
Enumerator | |
---|---|
Standard | |
Delimited |
Definition at line 65 of file Transport.h.
|
strong |
Enumerator | |
---|---|
PlainText | |
Markdown |
Definition at line 380 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 627 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
UnsupportedEncoding | |
UTF16 | |
UTF8 | |
UTF32 |
Definition at line 364 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Idle | |
Building |
Definition at line 86 of file TUScheduler.h.
|
strong |
|
strong |
Enumerator | |
---|---|
BaseOf |
Definition at line 22 of file Relation.h.
|
strong |
A symbol kind.
Definition at line 321 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
AST | |
Dynamic | |
Static | |
Merge | |
Identifier |
Definition at line 21 of file SymbolOrigin.h.
|
strong |
Defines how the host (editor) should sync document changes to the language server.
Definition at line 268 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Off | |
Messages | |
Verbose |
Definition at line 253 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Children | |
Parents | |
Both |
Definition at line 1270 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 48 of file TUScheduler.h.
llvm::SmallString<256> clang::clangd::abbreviatedString | ( | DynTypedNode | N, |
const PrintingPolicy & | PP | ||
) |
Definition at line 715 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.
CompletionItemKind clang::clangd::adjustKindToCapability | ( | CompletionItemKind | Kind, |
CompletionItemKindBitset & | SupportedCompletionItemKinds | ||
) |
Definition at line 859 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 212 of file Protocol.cpp.
References Class, Enum, EnumMember, Kind, String, Struct, and SymbolKindMin.
llvm::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 606 of file Rename.cpp.
bool clang::clangd::allowImplicitCompletion | ( | llvm::StringRef | Content, |
unsigned | Offset | ||
) |
Definition at line 1944 of file CodeComplete.cpp.
References isIncludeFile(), Offset, and Pos.
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > clang::clangd::allTargetDecls | ( | const ast_type_traits::DynTypedNode & | ) |
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 545 of file FindTarget.cpp.
References dlog.
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 49 of file PathMapping.cpp.
|
static |
Definition at line 978 of file ClangdLSPServer.cpp.
References Action.
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 45 of file Compiler.cpp.
References clang::clangd::ParseOptions::BuildRecoveryAST, CI, clang::clangd::ParseInputs::CompileCommand, Inputs, None, clang::clangd::ParseInputs::Opts, clang::clangd::ParseOptions::PreserveRecoveryASTType, clang::clangd::ParseInputs::TFS, and clang::clangd::ThreadsafeFS::view().
Referenced by clang::clangd::TestTU::build(), and clang::clangd::TestTU::preamble().
std::shared_ptr< const PreambleData > clang::clangd::buildPreamble | ( | PathRef | FileName, |
CompilerInvocation | CI, | ||
const ParseInputs & | Inputs, | ||
bool | StoreInMemory, | ||
PreambleParsedCallback | PreambleCallback | ||
) |
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.
Definition at line 321 of file Preamble.cpp.
Referenced by clang::clangd::TestTU::build(), and clang::clangd::TestTU::preamble().
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 536 of file Rename.cpp.
References clang::clangd::Position::line, Offset, positionToOffset(), SPAN_ATTACH, clang::tidy::cppcoreguidelines::toString(), 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 22 of file TestFS.cpp.
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 CharRoles, CharTypes, Empty, 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 46 of file FileDistance.cpp.
Referenced by clang::clangd::FileDistance::distance().
|
static |
Definition at line 92 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 118 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Constructor, clang::clangd::SymbolQualitySignals::Destructor, clang::clangd::SymbolQualitySignals::Function, clang::clangd::SymbolQualitySignals::Macro, clang::clangd::SymbolQualitySignals::Namespace, clang::clangd::SymbolQualitySignals::Type, and clang::clangd::SymbolQualitySignals::Variable.
|
static |
Definition at line 62 of file Quality.cpp.
References Constructor, Decl, Function, MAP, Namespace, clang::clangd::SymbolQualitySignals::Operator, Type, Unknown, and Variable.
Referenced by categorize(), and clang::clangd::SymbolQualitySignals::merge().
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 593 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 1768 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 306 of file clangd/IncludeFixer.cpp.
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 627 of file SourceCode.cpp.
llvm::StringMap< unsigned > clang::clangd::collectIdentifiers | ( | llvm::StringRef | Content, |
const format::FormatStyle & | Style | ||
) |
Collects identifiers with counts in the source code.
Definition at line 613 of file SourceCode.cpp.
std::unique_ptr< PPCallbacks > clang::clangd::collectIncludeStructureCallback | ( | const SourceManager & | SM, |
IncludeStructure * | Out | ||
) |
Returns a PPCallback that visits all inclusions in the main file.
Definition at line 152 of file Headers.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
Definition at line 63 of file CanonicalIncludes.cpp.
llvm::StringSet clang::clangd::collectWords | ( | llvm::StringRef | Content | ) |
Collects words from the source code.
Unlike collectIdentifiers:
Definition at line 840 of file SourceCode.cpp.
References calculateRoles().
|
static |
Definition at line 264 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::ClassScope, clang::clangd::SymbolRelevanceSignals::FileScope, clang::clangd::SymbolRelevanceSignals::FunctionScope, clang::clangd::SymbolRelevanceSignals::GlobalScope, and hasUnstableLinkage().
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
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 193 of file PathMapping.cpp.
|
static |
Definition at line 186 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 206 of file IndexAction.cpp.
|
static |
Definition at line 22 of file Context.cpp.
References clang::clangd::Context::empty().
Referenced by clang::clangd::Context::current(), and clang::clangd::Context::swapCurrent().
|
static |
std::vector< LineHighlightings > clang::clangd::diffHighlightings | ( | ArrayRef< HighlightingToken > | New, |
ArrayRef< HighlightingToken > | Old | ||
) |
Return a line-by-line diff between two highlightings.
REQUIRED: Old and New are sorted.
Definition at line 409 of file SemanticHighlighting.cpp.
std::vector< SemanticTokensEdit > clang::clangd::diffTokens | ( | llvm::ArrayRef< SemanticToken > | Old, |
llvm::ArrayRef< SemanticToken > | New | ||
) |
Definition at line 632 of file SemanticHighlighting.cpp.
References Offset.
FileDigest clang::clangd::digest | ( | llvm::StringRef | Content | ) |
Definition at line 560 of file SourceCode.cpp.
FileDigest clang::clangd::digest | ( | StringRef | Content | ) |
Optional< FileDigest > clang::clangd::digestFile | ( | const SourceManager & | SM, |
FileID | FID | ||
) |
Definition at line 570 of file SourceCode.cpp.
llvm::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 21 of file PathMapping.cpp.
void clang::clangd::dumpAST | ( | ParsedAST & | AST, |
llvm::raw_ostream & | OS | ||
) |
For testing/debugging purposes.
Note that this method deserializes all unserialized Decls, so use with care.
Definition at line 241 of file ParsedAST.cpp.
References clang::clangd::ParsedAST::getASTContext(), and OS.
void clang::clangd::elog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 56 of file Logger.h.
References clang::clangd::Logger::Error, and clang::clangd::detail::log().
Referenced by clang::clangd::URIForFile::canonicalize(), clang::clangd::PreamblePatch::create(), clang::clangd::remote::fromProtobuf(), iterateCodepoints(), loadIndex(), clang::clangd::remote::relativePathToURI(), clang::clangd::TUScheduler::remove(), signatureHelp(), clang::clangd::remote::uriToRelativePath(), and clang::clangd::ThreadsafeFS::view().
|
static |
Definition at line 473 of file Quality.cpp.
Referenced by sortText().
|
static |
Definition at line 1000 of file Protocol.cpp.
void clang::clangd::escapeBackslashAndQuotes | ( | llvm::StringRef | Text, |
llvm::raw_ostream & | OS | ||
) |
Definition at line 391 of file Preamble.cpp.
Referenced by clang::clangd::PreamblePatch::create().
float clang::clangd::evaluateSymbolAndRelevance | ( | float | SymbolQuality, |
float | SymbolRelevance | ||
) |
Combine symbol quality and relevance into a single score.
Definition at line 467 of file Quality.cpp.
llvm::SmallVector<const NamedDecl *, 1> clang::clangd::explicitReferenceTargets | ( | ast_type_traits::DynTypedNode | N, |
DeclRelationSet | Mask | ||
) |
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.
llvm::SmallVector<const NamedDecl *, 1> clang::clangd::explicitReferenceTargets | ( | DynTypedNode | N, |
DeclRelationSet | Mask | ||
) |
Definition at line 578 of file FindTarget.cpp.
References TemplateInstantiation, and TemplatePattern.
llvm::Optional<CheapUnresolvedName> clang::clangd::extractUnresolvedNameCheaply | ( | const SourceManager & | SM, |
const DeclarationNameInfo & | Unresolved, | ||
CXXScopeSpec * | SS, | ||
const LangOptions & | LangOpts, | ||
bool | UnresolvedIsSpecifier | ||
) |
Definition at line 231 of file clangd/IncludeFixer.cpp.
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo().
|
static |
Definition at line 153 of file Background.cpp.
Referenced by clang::clangd::BackgroundIndex::boostRelated().
|
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 548 of file Diagnostics.cpp.
|
static |
|
static |
const NamedDecl & clang::clangd::findDecl | ( | ParsedAST & | AST, |
llvm::StringRef | QName | ||
) |
Definition at line 165 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 186 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 980 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findDocumentHighlights().
void clang::clangd::findExplicitReferences | ( | const ASTContext & | AST, |
llvm::function_ref< void(ReferenceLoc)> | Out | ||
) |
Definition at line 1027 of file FindTarget.cpp.
References Out.
void clang::clangd::findExplicitReferences | ( | const Decl * | D, |
llvm::function_ref< void(ReferenceLoc)> | Out | ||
) |
Definition at line 1022 of file FindTarget.cpp.
References Out.
void clang::clangd::findExplicitReferences | ( | const Stmt * | S, |
llvm::function_ref< void(ReferenceLoc)> | Out | ||
) |
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 1017 of file FindTarget.cpp.
References Out.
Referenced by getNonLocalDeclRefs(), and getSemanticHighlightings().
const syntax::Token * clang::clangd::findNearbyIdentifier | ( | const SpelledWord & | Word, |
const syntax::TokenBuffer & | TB | ||
) |
Find the record type references at Pos
.
Definition at line 1313 of file XRefs.cpp.
Referenced by getTypeHierarchy().
ReferencesResult clang::clangd::findReferences | ( | ParsedAST & | AST, |
Position | Pos, | ||
uint32_t | Limit, | ||
const SymbolIndex * | Index = nullptr |
||
) |
const Symbol & clang::clangd::findSymbol | ( | const SymbolSlab & | Slab, |
llvm::StringRef | QName | ||
) |
Definition at line 144 of file TestTU.cpp.
const NamedDecl & clang::clangd::findUnqualifiedDecl | ( | ParsedAST & | AST, |
llvm::StringRef | Name | ||
) |
Definition at line 206 of file TestTU.cpp.
References findDecl(), 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 932 of file ClangdLSPServer.cpp.
References 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, Symbols, 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 208 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 247 of file Format.cpp.
|
inline |
Definition at line 261 of file Protocol.h.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKind & | Out | ||
) |
Definition at line 847 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKindBitset & | Out | ||
) |
Definition at line 880 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
FileChangeType & | Out | ||
) |
Definition at line 473 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKind & | Out | ||
) |
Definition at line 189 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKindBitset & | Out | ||
) |
Definition at line 200 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TraceLevel & | Out | ||
) |
Definition at line 173 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TypeHierarchyDirection & | Out | ||
) |
Definition at line 1095 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
URIForFile & | R | ||
) |
Definition at line 54 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Parameters, |
FuzzyFindRequest & | Request | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClangdCompileCommand & | CDbUpdate | ||
) |
Definition at line 1068 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClientCapabilities & | R | ||
) |
Definition at line 289 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionContext & | R | ||
) |
Definition at line 572 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionParams & | R | ||
) |
Definition at line 599 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionContext & | R | ||
) |
Definition at line 774 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionParams & | R | ||
) |
Definition at line 789 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ConfigurationSettings & | S | ||
) |
Definition at line 1075 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Diagnostic & | R | ||
) |
Definition at line 551 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeConfigurationParams & | CCP | ||
) |
Definition at line 1062 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeTextDocumentParams & | R | ||
) |
Definition at line 463 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeWatchedFilesParams & | R | ||
) |
Definition at line 489 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidCloseTextDocumentParams & | R | ||
) |
Definition at line 453 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidOpenTextDocumentParams & | R | ||
) |
Definition at line 448 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidSaveTextDocumentParams & | R | ||
) |
Definition at line 458 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentFormattingParams & | R | ||
) |
Definition at line 514 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentLinkParams & | R | ||
) |
Definition at line 1232 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentOnTypeFormattingParams & | R | ||
) |
Definition at line 507 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentRangeFormattingParams & | R | ||
) |
Definition at line 501 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentSymbolParams & | R | ||
) |
Definition at line 519 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ExecuteCommandParams & | R | ||
) |
Definition at line 615 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FileEvent & | R | ||
) |
Definition at line 484 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FoldingRangeParams & | R | ||
) |
Definition at line 1244 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializationOptions & | Opts | ||
) |
Definition at line 1083 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializeParams & | R | ||
) |
Definition at line 387 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Position & | R | ||
) |
Definition at line 106 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Range & | R | ||
) |
Definition at line 122 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceParams & | R | ||
) |
Definition at line 1165 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
RenameParams & | R | ||
) |
Definition at line 979 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ResolveTypeHierarchyItemParams & | P | ||
) |
Definition at line 1158 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SelectionRangeParams & | P | ||
) |
Definition at line 1218 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensDeltaParams & | R | ||
) |
Definition at line 1046 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensParams & | R | ||
) |
Definition at line 1041 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentContentChangeEvent & | R | ||
) |
Definition at line 494 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentIdentifier & | R | ||
) |
Definition at line 88 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentItem & | R | ||
) |
Definition at line 149 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentPositionParams & | R | ||
) |
Definition at line 768 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextEdit & | R | ||
) |
Definition at line 155 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TweakArgs & | A | ||
) |
Definition at line 744 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyItem & | I | ||
) |
Definition at line 1138 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyParams & | R | ||
) |
Definition at line 1106 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
VersionedTextDocumentIdentifier & | R | ||
) |
Definition at line 99 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceEdit & | R | ||
) |
Definition at line 605 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceSymbolParams & | R | ||
) |
Definition at line 684 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Response, |
ApplyWorkspaceEditResponse & | R | ||
) |
Definition at line 759 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
MarkupKind & | K | ||
) |
Definition at line 807 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
OffsetEncoding & | OE | ||
) |
Definition at line 1184 of file Protocol.cpp.
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 83 of file TestIndex.cpp.
SymbolSlab clang::clangd::generateSymbols | ( | std::vector< std::string > | QualifiedNames | ) |
Definition at line 76 of file TestIndex.cpp.
References clang::clangd::SymbolSlab::Builder::insert(), and symbol().
llvm::Optional<llvm::StringRef> clang::clangd::getBacktickQuoteRange | ( | llvm::StringRef | Line, |
unsigned | Offset | ||
) |
Definition at line 972 of file Hover.cpp.
Referenced by parseDocumentationLine().
llvm::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 512 of file SourceCode.cpp.
llvm::Optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | const Path & | 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 19 of file HeaderSourceSwitch.cpp.
Referenced by clang::clangd::ClangdServer::switchSourceHeader().
llvm::Optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | const Path & | 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 72 of file HeaderSourceSwitch.cpp.
References getIndexableLocalDecls(), and Index.
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.
llvm::Optional< QualType > clang::clangd::getDeducedType | ( | ASTContext & | , |
SourceLocation | Loc | ||
) |
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 1215 of file TUScheduler.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 612 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 270 of file FindSymbols.cpp.
References AST.
Referenced by clang::clangd::ClangdServer::documentSymbols(), and getFoldingRanges().
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 1042 of file SourceCode.cpp.
|
static |
Definition at line 376 of file SourceCode.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 105 of file SemanticSelection.cpp.
References getDocumentSymbols().
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 578 of file SourceCode.cpp.
llvm::Optional< HoverInfo > clang::clangd::getHover | ( | ParsedAST & | AST, |
Position | Pos, | ||
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 127 of file HeaderSourceSwitch.cpp.
References Decl, clang::clangd::ParsedAST::getLocalTopLevelDecls(), Results, and clang::clangd::SymbolCollector::shouldCollectSymbol().
Referenced by getCorrespondingHeaderOrSource().
|
static |
Definition at line 308 of file SourceCode.cpp.
|
static |
Definition at line 300 of file SourceCode.cpp.
llvm::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 None if we don't find a mapping.
Exposed for testing only.
REQUIRED: Indexed and Lexed are sorted.
Definition at line 617 of file Rename.cpp.
References None, renameRangeAdjustmentCost(), SPAN_ATTACH, Tracer, and vlog().
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 1458 of file XRefs.cpp.
References Decl, and findExplicitReferences().
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::
Definition at line 447 of file AST.cpp.
References getQualification(), Namespace, and OS.
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.
Definition at line 428 of file AST.cpp.
References InsertionPoint, and Namespace.
Referenced by getQualification().
std::string clang::clangd::getQualifiedName | ( | const Symbol & | Sym | ) |
Definition at line 90 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 187 of file AST.cpp.
Referenced by printName().
std::unique_ptr< GlobalCompilationDatabase > clang::clangd::getQueryDriverDatabase | ( | llvm::ArrayRef< std::string > | QueryDriverGlobs, |
std::unique_ptr< GlobalCompilationDatabase > | Base | ||
) |
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags.
Base may not be nullptr. Returns Base when QueryDriverGlobs
is empty.
Definition at line 295 of file QueryDriverDatabase.cpp.
References Base.
llvm::SmallVector< llvm::StringRef, 1 > clang::clangd::getRankedIncludes | ( | const Symbol & | Sym | ) |
Definition at line 136 of file Headers.cpp.
RefSlab clang::clangd::getRefs | ( | const SymbolIndex & | Index, |
SymbolID | ID | ||
) |
Definition at line 134 of file SyncAPI.cpp.
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 238 of file CodeCompletionStrings.cpp.
std::vector< HighlightingToken > clang::clangd::getSemanticHighlightings | ( | ParsedAST & | AST | ) |
Definition at line 340 of file SemanticHighlighting.cpp.
References Builder, findExplicitReferences(), clang::clangd::ParsedAST::getASTContext(), clang::clangd::ParsedAST::getMacros(), Kind, Macro, clang::clangd::MainFileMacros::MacroRefs, clang::clangd::ReferenceLoc::NameLoc, and clang::clangd::MainFileMacros::UnknownMacros.
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 46 of file SemanticSelection.cpp.
int clang::clangd::getSeverity | ( | DiagnosticsEngine::Level | L | ) |
Convert from clang diagnostic level to LSP severity.
Definition at line 450 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 92 of file CodeCompletionStrings.cpp.
llvm::Optional< SymbolID > clang::clangd::getSymbolID | ( | const llvm::StringRef | MacroName, |
const MacroInfo * | MI, | ||
const SourceManager & | SM | ||
) |
Gets the symbol ID for a macro, if possible.
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 1123 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::symbolInfo().
|
static |
Definition at line 1088 of file ClangdLSPServer.cpp.
References clang::clangd::Range::contains(), clang::clangd::LocatedSymbol::Definition, clang::clangd::URIForFile::file(), clang::clangd::TextDocumentPositionParams::position, clang::clangd::LocatedSymbol::PreferredDeclaration, clang::clangd::Location::range, clang::clangd::TextDocumentPositionParams::textDocument, clang::clangd::TextDocumentIdentifier::uri, and clang::clangd::Location::uri.
|
static |
Definition at line 393 of file SourceCode.cpp.
|
static |
Definition at line 284 of file SourceCode.cpp.
llvm::Optional< TypeHierarchyItem > clang::clangd::getTypeHierarchy | ( | ParsedAST & | AST, |
Position | Pos, | ||
int | ResolveLevels, | ||
TypeHierarchyDirection | Direction, | ||
const SymbolIndex * | Index, | ||
PathRef | TUPath | ||
) |
Get type hierarchy information at Pos
.
Definition at line 1399 of file XRefs.cpp.
References findRecordTypeAt(), None, and Pos.
Referenced by clang::clangd::ClangdServer::typeHierarchy().
llvm::Expected< std::vector< SymbolInformation > > clang::clangd::getWorkspaceSymbols | ( | llvm::StringRef | Query, |
int | Limit, | ||
const SymbolIndex *const | Index, | ||
llvm::StringRef | HintPath | ||
) |
Searches for the symbols matching Query
.
The syntax of Query
can be the non-qualified name or fully qualified of a symbol. For example, "vector" will match the symbol std::vector and "std::vector" would also match it. Direct children of scopes (namespaces, etc) can be listed with a trailing "::". For example, "std::" will list all children of the std namespace and "::" alone will list all children of the global namespace. Limit
limits the number of results returned (0 means no limit). HintPath
This is used when resolving URIs. If empty, URI resolution can fail if a hint path is required for the scheme of a specific URI.
Definition at line 71 of file FindSymbols.cpp.
CompletionPrefix clang::clangd::guessCompletionPrefix | ( | llvm::StringRef | Content, |
unsigned | Offset | ||
) |
Definition at line 1746 of file CodeComplete.cpp.
References Offset.
Range clang::clangd::halfOpenToRange | ( | const SourceManager & | SM, |
CharSourceRange | R | ||
) |
Definition at line 471 of file SourceCode.cpp.
|
static |
Definition at line 43 of file Quality.cpp.
References isInsideMainFile(), and SourceMgr.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
llvm::hash_code clang::clangd::hash_value | ( | const SymbolID & | ID | ) |
Definition at line 50 of file SymbolID.cpp.
Referenced by clang::clangd::FileDistance::distance(), clang::clangd::URIDistance::distance(), llvm::DenseMapInfo< clang::clangd::SymbolID >::getHashValue(), and llvm::DenseMapInfo< clang::clangd::dex::Token >::getHashValue().
PolySubsequenceMatcher<Args...> clang::clangd::HasSubsequence | ( | Args &&... | M | ) |
Definition at line 106 of file clangd/unittests/Matchers.h.
bool clang::clangd::hasUnstableLinkage | ( | const Decl * | D | ) |
Whether we must avoid computing linkage for D during code completion.
Clang aggressively caches linkage computation, which is stable after the AST is built. Unfortunately the AST is incomplete during code completion, so linkage may still change.
Example: auto x = []{^}
at file scope. During code completion, the initializer for x hasn't been parsed yet. x has type undeduced auto
, and external linkage. If we compute linkage at this point, the external linkage will be cached.
After code completion the initializer is attached, and x has a lambda type. This means x has "unique external" linkage. If we computed linkage above, the cached value is incorrect. (clang catches this with an assertion).
Definition at line 467 of file AST.cpp.
Referenced by computeScope().
|
static |
Definition at line 52 of file Quality.cpp.
References isInsideMainFile(), and SourceMgr.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
inline |
Definition at line 193 of file clangd/unittests/Matchers.h.
SourceLocation clang::clangd::includeHashLoc | ( | FileID | IncludedFile, |
const SourceManager & | SM | ||
) |
Returns the #include location through which IncludedFIle was loaded.
Where SM.getIncludeLoc() returns the location of the filename, which may be in a macro, includeHashLoc() returns the location of the #.
Definition at line 262 of file SourceCode.cpp.
|
static |
Definition at line 1288 of file ClangdLSPServer.cpp.
SlabTuple clang::clangd::indexHeaderSymbols | ( | llvm::StringRef | Version, |
ASTContext & | AST, | ||
std::shared_ptr< Preprocessor > | PP, | ||
const CanonicalIncludes & | Includes | ||
) |
Index declarations from AST
and macros from PP
that are declared in included headers.
Definition at line 215 of file FileIndex.cpp.
Referenced by clang::clangd::TestTU::headerSymbols().
Retrieves symbols and refs of local top level decls in AST
(i.e.
AST.getLocalTopLevelDecls()
). Exposed to assist in unit tests.
Definition at line 208 of file FileIndex.cpp.
References clang::clangd::ParsedAST::getASTContext(), clang::clangd::ParsedAST::getCanonicalIncludes(), clang::clangd::ParsedAST::getLocalTopLevelDecls(), clang::clangd::ParsedAST::getMacros(), clang::clangd::ParsedAST::getPreprocessorPtr(), and clang::clangd::ParsedAST::version().
Referenced by clang::clangd::TestTU::headerRefs(), and clang::clangd::FileIndex::updateMain().
SymbolKind clang::clangd::indexSymbolKindToSymbolKind | ( | index::SymbolKind | Kind | ) |
Definition at line 230 of file Protocol.cpp.
References Kind.
Referenced by symbolToTypeHierarchyItem().
llvm::Expected< Location > clang::clangd::indexToLSPLocation | ( | const SymbolLocation & | Loc, |
llvm::StringRef | TUPath | ||
) |
Helper function for deriving an LSP Location from an index SymbolLocation.
Definition at line 43 of file FindSymbols.cpp.
References clang::clangd::URIForFile::canonicalize(), Loc, clang::clangd::URI::resolve(), clang::tidy::cppcoreguidelines::toString(), and clang::clangd::Location::uri.
Referenced by symbolToLocation().
|
static |
Definition at line 183 of file AST.cpp.
Referenced by printName().
|
static |
Definition at line 73 of file FuzzyMatch.cpp.
References AwfulScore.
Referenced by clang::clangd::FuzzyMatcher::match().
int clang::clangd::isCancelled | ( | const Context & | Ctx = Context::current() | ) |
If the current context is within a cancelled task, returns the reason.
(If the context is within multiple nested tasks, true if any are cancelled). Always zero if there is no active cancelable task. This isn't free (context lookup) - don't call it in a tight loop.
Definition at line 35 of file Cancellation.cpp.
References Ctx, clang::clangd::Context::get(), and StateKey.
|
static |
Definition at line 774 of file SymbolCollector.cpp.
References Line.
bool clang::clangd::isExplicitTemplateSpecialization | ( | const NamedDecl * | D | ) |
Indicates if D
is an explicit template specialization, e.g.
template <class t>=""> struct vector {}; template <> struct vector<bool> {}; // <– explicit specialization
Note that explicit instantiations are NOT explicit specializations, albeit they look similar. template struct vector<bool>; // <– explicit instantiation, NOT an explicit specialization.
Definition at line 152 of file AST.cpp.
Referenced by clang::find_all_symbols::FindAllSymbols::registerMatchers().
bool clang::clangd::isHeaderFile | ( | llvm::StringRef | FileName, |
llvm::Optional< LangOptions > | LangOpts | ||
) |
Infers whether this is a header from the FileName and LangOpts (if presents).
Definition at line 1095 of file SourceCode.cpp.
Referenced by clang::clangd::BackgroundIndex::boostRelated().
|
static |
Definition at line 766 of file SymbolCollector.cpp.
References Line.
bool clang::clangd::isImplementationDetail | ( | const Decl * | D | ) |
Returns true if the declaration is considered implementation detail based on heuristics.
For example, a declaration whose name is not explicitly spelled in code is considered implementation detail.
Definition at line 156 of file AST.cpp.
References isSpelledInSource().
Referenced by clang::clangd::SymbolQualitySignals::merge().
bool clang::clangd::isImplicitTemplateInstantiation | ( | const NamedDecl * | D | ) |
bool clang::clangd::isIncludeFile | ( | llvm::StringRef | Line | ) |
Definition at line 1928 of file CodeComplete.cpp.
References Line.
Referenced by allowImplicitCompletion().
bool clang::clangd::isIndexedForCodeCompletion | ( | const NamedDecl & | ND, |
ASTContext & | ASTCtx | ||
) |
Definition at line 1813 of file CodeComplete.cpp.
bool clang::clangd::isInsideMainFile | ( | SourceLocation | Loc, |
const SourceManager & | SM | ||
) |
Returns true iff Loc
is inside the main file.
This function handles file & macro locations. For macro locations, returns iff the macro is being expanded inside the main file.
The function is usually used to check whether a declaration is inside the the main file.
Definition at line 421 of file SourceCode.cpp.
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo(), clang::clangd::CollectMainFileMacros::FileChanged(), hasDeclInMainFile(), and hasUsingDeclInMainFile().
|
static |
Definition at line 172 of file Quality.cpp.
|
static |
Definition at line 162 of file Quality.cpp.
References CM.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
Definition at line 878 of file SourceCode.cpp.
bool clang::clangd::isLiteralInclude | ( | llvm::StringRef | Include | ) |
Returns true if Include
is literal include like "path" or <path>.
Definition at line 107 of file Headers.cpp.
Referenced by toHeaderFile(), and clang::clangd::HeaderFile::valid().
bool clang::clangd::isPreambleCompatible | ( | const PreambleData & | Preamble, |
const ParseInputs & | Inputs, | ||
PathRef | FileName, | ||
const CompilerInvocation & | CI | ||
) |
Returns true if Preamble
is reusable for Inputs
.
Note that it will return true when some missing headers are now available. FIXME: Should return more information about the delta between Preamble
and Inputs
, e.g. new headers.
Definition at line 377 of file Preamble.cpp.
References Bounds, CI, clang::clangd::ParseInputs::CompileCommand, clang::clangd::PreambleData::CompileCommand, clang::clangd::ParseInputs::Contents, FileName, Inputs, clang::clangd::PreambleData::Preamble, Preamble, clang::clangd::ParseInputs::TFS, and clang::clangd::ThreadsafeFS::view().
bool clang::clangd::isProtoFile | ( | SourceLocation | Loc, |
const SourceManager & | SM | ||
) |
Returns true if the given location is in a generated protobuf file.
Definition at line 1107 of file SourceCode.cpp.
|
static |
Definition at line 37 of file Quality.cpp.
References Name.
Referenced by clang::clangd::SymbolQualitySignals::merge().
bool clang::clangd::isSpelledInSource | ( | SourceLocation | Loc, |
const SourceManager & | SM | ||
) |
Returns true if the token at Loc is spelled in the source code.
This is not the case for:
-DName=foo
, the spelling location will be "<command line>". Definition at line 237 of file SourceCode.cpp.
Referenced by isImplementationDetail().
bool clang::clangd::isValidFileRange | ( | const SourceManager & | Mgr, |
SourceRange | R | ||
) |
Returns true iff all of the following conditions hold:
Definition at line 247 of file SourceCode.cpp.
|
static |
xpc_object_t clang::clangd::jsonToXpc | ( | const json::Value & | JSON | ) |
Definition at line 20 of file Conversion.cpp.
Referenced by main().
xpc_object_t clang::clangd::jsonToXpc | ( | const llvm::json::Value & | JSON | ) |
|
static |
Definition at line 602 of file SourceCode.cpp.
std::unique_ptr< SymbolIndex > clang::clangd::loadIndex | ( | llvm::StringRef | SymbolFilename, |
bool | UseDex | ||
) |
Definition at line 668 of file Serialization.cpp.
std::vector< LoadedShard > clang::clangd::loadIndexShards | ( | llvm::ArrayRef< Path > | MainFiles, |
BackgroundIndexStorage::Factory & | IndexStorageFactory, | ||
const GlobalCompilationDatabase & | CDB | ||
) |
Loads all shards for the TU MainFile
from Storage
.
Definition at line 123 of file BackgroundIndexLoader.cpp.
llvm::Optional< DefinedMacro > clang::clangd::locateMacroAt | ( | const syntax::Token & | SpelledTok, |
Preprocessor & | PP | ||
) |
Gets the macro referenced by SpelledTok
.
It must be a spelled token aligned to the beginning of an identifier.
Definition at line 968 of file SourceCode.cpp.
References Loc, and SpelledTok.
std::vector< LocatedSymbol > clang::clangd::locateSymbolAt | ( | ParsedAST & | AST, |
Position | Pos, | ||
const SymbolIndex * | Index = nullptr |
||
) |
Get definition of symbol at a specified Pos
.
Multiple locations may be returned, corresponding to distinct symbols.
Definition at line 542 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::locateSymbolAt().
std::vector< LocatedSymbol > clang::clangd::locateSymbolTextually | ( | const SpelledWord & | Word, |
ParsedAST & | AST, | ||
const SymbolIndex * | Index, | ||
const std::string & | MainFilePath, | ||
ASTNodeKind | NodeKind | ||
) |
void clang::clangd::log | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 62 of file Logger.h.
References clang::clangd::Logger::Info, and clang::clangd::detail::log().
Referenced by clang::clangd::ParsedAST::build(), clang::clangd::URIDistance::distance(), clang::clangd::DirectoryBasedGlobalCompilationDatabase::getCompileCommand(), main(), symbolToTypeHierarchyItem(), and updateVersion().
|
static |
Definition at line 54 of file LSPClient.cpp.
std::vector< std::string > clang::clangd::lookup | ( | const SymbolIndex & | I, |
llvm::ArrayRef< SymbolID > | IDs | ||
) |
Definition at line 106 of file TestIndex.cpp.
References getQualifiedName(), clang::clangd::LookupRequest::IDs, clang::clangd::SymbolIndex::lookup(), and Results.
|
static |
Definition at line 68 of file FuzzyMatch.cpp.
Referenced by clang::tidy::bugprone::isLikelyTypo().
|
static |
Definition at line 145 of file SourceCode.cpp.
References clang::clangd::Context::current(), clang::clangd::Context::get(), kCurrentOffsetEncoding, and UTF16.
Referenced by lspLength(), and positionToOffset().
size_t clang::clangd::lspLength | ( | llvm::StringRef | Code | ) |
Definition at line 151 of file SourceCode.cpp.
References Code, iterateCodepoints(), lspEncoding(), UnsupportedEncoding, UTF16, UTF32, and UTF8.
Referenced by offsetToPosition().
size_t clang::clangd::lspLength | ( | StringRef | Code | ) |
std::vector< std::string > clang::clangd::match | ( | const SymbolIndex & | I, |
const FuzzyFindRequest & | Req, | ||
bool * | Incomplete | ||
) |
Definition at line 94 of file TestIndex.cpp.
clang::clangd::MATCHER | ( | Declared | , |
"" | |||
) |
Definition at line 31 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER | ( | Defined | , |
"" | |||
) |
Definition at line 34 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER | ( | EmptyIncludeNode | , |
"" | |||
) |
Definition at line 41 of file BackgroundIndexTests.cpp.
References clang::clangd::IncludeGraphNode::None.
clang::clangd::MATCHER | ( | HadErrors | , |
"" | |||
) |
Definition at line 46 of file BackgroundIndexTests.cpp.
References clang::clangd::IncludeGraphNode::HadErrors.
clang::clangd::MATCHER_P | ( | FileURI | , |
F | , | ||
"" | |||
) |
Definition at line 35 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | Named | , |
N | , | ||
"" | |||
) |
Definition at line 29 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | NumReferences | , |
N | , | ||
"" | |||
) |
Definition at line 50 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | QName | , |
N | , | ||
"" | |||
) |
Definition at line 30 of file BackgroundIndexTests.cpp.
|
static |
Definition at line 94 of file GlobalCompilationDatabase.cpp.
|
static |
Definition at line 107 of file SourceCode.cpp.
Referenced by positionToOffset().
Definition at line 172 of file Merge.cpp.
References clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::CompletionSnippetSuffix, clang::clangd::Symbol::Definition, clang::clangd::Symbol::Documentation, clang::clangd::SymbolLocation::FileURI, clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, clang::clangd::Symbol::IncludeHeaders, Merge, clang::clangd::Symbol::Origin, prefer(), clang::clangd::Symbol::References, clang::clangd::Symbol::ReturnType, clang::clangd::Symbol::Signature, clang::clangd::Symbol::SymInfo, and clang::clangd::Symbol::Type.
Referenced by clang::clangd::FileSymbols::buildIndex(), clang::clangd::MergedIndex::fuzzyFind(), and clang::clangd::MergedIndex::lookup().
SourceLocation clang::clangd::nameLocation | ( | const clang::Decl & | D, |
const SourceManager & | SM | ||
) |
std::unique_ptr< Transport > clang::clangd::newJSONTransport | ( | std::FILE * | In, |
llvm::raw_ostream & | Out, | ||
llvm::raw_ostream * | InMirror, | ||
bool | Pretty, | ||
JSONStreamStyle | Style | ||
) |
Definition at line 320 of file JSONTransport.cpp.
std::unique_ptr<Transport> clang::clangd::newXPCTransport | ( | ) |
Definition at line 212 of file XPCTransport.cpp.
Symbol clang::clangd::ns | ( | llvm::StringRef | Name | ) |
Definition at line 72 of file TestIndex.cpp.
std::pair< size_t, size_t > clang::clangd::offsetToClangLineColumn | ( | llvm::StringRef | Code, |
size_t | Offset | ||
) |
Definition at line 479 of file SourceCode.cpp.
References Code, Lines, and Offset.
Referenced by clang::clangd::PreamblePatch::create().
Position clang::clangd::offsetToPosition | ( | llvm::StringRef | Code, |
size_t | Offset | ||
) |
Turn an offset in Code into a [line, column] pair.
The offset must be in range [0, Code.size()].
Definition at line 208 of file SourceCode.cpp.
References clang::clangd::Position::character, Code, clang::clangd::Position::line, Lines, lspLength(), Offset, and Pos.
Referenced by clang::clangd::Annotations::point(), clang::clangd::Annotations::points(), replacementToEdit(), and toLSPRange().
|
inline |
Definition at line 198 of file FindTarget.h.
|
inline |
|
inline |
Definition at line 38 of file SymbolOrigin.h.
bool clang::clangd::operator< | ( | const CompletionItem & | L, |
const CompletionItem & | R | ||
) |
Definition at line 924 of file Protocol.cpp.
References clang::clangd::CompletionItem::label, and clang::clangd::CompletionItem::sortText.
bool clang::clangd::operator< | ( | const HighlightingToken & | L, |
const HighlightingToken & | R | ||
) |
Definition at line 469 of file SemanticHighlighting.cpp.
References clang::clangd::HighlightingToken::Kind, and clang::clangd::HighlightingToken::R.
Definition at line 93 of file Ref.h.
References clang::clangd::Ref::Kind, and clang::clangd::Ref::Location.
|
inline |
Definition at line 82 of file SymbolLocation.h.
References clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, and clang::clangd::SymbolLocation::Start.
|
inline |
Definition at line 72 of file SymbolLocation.h.
References clang::clangd::SymbolLocation::Position::column(), and clang::clangd::SymbolLocation::Position::line().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const CompletionItem & | I | ||
) |
Definition at line 919 of file Protocol.cpp.
References clang::clangd::CompletionItem::label, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const DocumentHighlight & | V | ||
) |
Definition at line 1052 of file Protocol.cpp.
References clang::clangd::DocumentHighlight::kind, clang::clangd::DocumentHighlight::range, Read, and Write.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const DocumentSymbol & | S | ||
) |
Definition at line 715 of file Protocol.cpp.
References clang::clangd::DocumentSymbol::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SignatureInformation & | I | ||
) |
Definition at line 961 of file Protocol.cpp.
References clang::clangd::SignatureInformation::label, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SymbolDetails & | S | ||
) |
Definition at line 672 of file Protocol.cpp.
References clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SymbolInformation & | SI | ||
) |
Definition at line 639 of file Protocol.cpp.
References clang::clangd::SymbolInformation::containerName, clang::clangd::SymbolInformation::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const TypeHierarchyItem & | I | ||
) |
Definition at line 1113 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::name, and toJSON().
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const CodeCompleteResult & | R | ||
) |
Definition at line 1917 of file CodeComplete.cpp.
References clang::clangd::CodeCompleteResult::Completions, clang::clangd::CodeCompleteResult::Context, clang::clangd::CodeCompleteResult::HasMore, and OS.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const CodeCompletion & | C | ||
) |
Definition at line 1912 of file CodeComplete.cpp.
References OS, and clang::clangd::CodeCompletion::render().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diag & | D | ||
) |
Definition at line 348 of file Diagnostics.cpp.
References Fix(), clang::clangd::Diag::Fixes, clang::clangd::Diag::Notes, and OS.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const DiagBase & | D | ||
) |
Definition at line 329 of file Diagnostics.cpp.
References clang::clangd::Range::end, clang::clangd::DiagBase::File, clang::clangd::DiagBase::InsideMainFile, clang::clangd::DiagBase::Message, OS, clang::clangd::DiagBase::Range, and clang::clangd::Range::start.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diagnostic & | D | ||
) |
Definition at line 577 of file Protocol.cpp.
References clang::clangd::Diagnostic::message, OS, clang::clangd::Diagnostic::range, and clang::clangd::Diagnostic::severity.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Fix & | F | ||
) |
Definition at line 338 of file Diagnostics.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const HoverInfo::Param & | P | ||
) |
Definition at line 1045 of file Hover.cpp.
References clang::clangd::HoverInfo::Param::Default, clang::tidy::cppcoreguidelines::join(), clang::clangd::HoverInfo::Param::Name, OS, Output, and clang::clangd::HoverInfo::Param::Type.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Inclusion & | Inc | ||
) |
Definition at line 267 of file Headers.cpp.
References clang::clangd::Inclusion::HashLine, OS, clang::clangd::Inclusion::Resolved, and clang::clangd::Inclusion::Written.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const IndexFileOut & | O | ||
) |
Definition at line 645 of file Serialization.cpp.
References clang::clangd::IndexFileOut::Format, OS, RIFF, writeYAML(), and YAML.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const LocatedSymbol & | S | ||
) |
Definition at line 1177 of file XRefs.cpp.
References clang::clangd::LocatedSymbol::Definition, clang::clangd::LocatedSymbol::Name, OS, and clang::clangd::LocatedSymbol::PreferredDeclaration.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Location & | L | ||
) |
Definition at line 145 of file Protocol.cpp.
References OS, clang::clangd::Location::range, and clang::clangd::Location::uri.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const PathMapping & | M | ||
) |
Definition at line 165 of file PathMapping.cpp.
References clang::clangd::PathMapping::ClientPath, OS, and clang::clangd::PathMapping::ServerPath.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Position & | P | ||
) |
Definition at line 118 of file Protocol.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and OS.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Range & | R | ||
) |
Definition at line 134 of file Protocol.cpp.
References clang::clangd::Range::end, OS, and clang::clangd::Range::start.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Ref & | R | ||
) |
Definition at line 32 of file Ref.cpp.
References clang::clangd::Ref::Kind, clang::clangd::Ref::Location, and OS.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SignatureQualitySignals & | S | ||
) |
Definition at line 497 of file Quality.cpp.
References clang::clangd::SignatureQualitySignals::Kind, clang::clangd::SignatureQualitySignals::NumberOfOptionalParameters, clang::clangd::SignatureQualitySignals::NumberOfParameters, and OS.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Symbol & | S | ||
) |
Definition at line 25 of file Symbol.cpp.
References clang::clangd::Symbol::Name, OS, and clang::clangd::Symbol::Scope.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolID & | ID | ||
) |
Definition at line 46 of file SymbolID.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolLocation & | L | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolQualitySignals & | S | ||
) |
Definition at line 253 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Category, clang::clangd::SymbolQualitySignals::Deprecated, clang::clangd::SymbolQualitySignals::evaluate(), OS, clang::clangd::SymbolQualitySignals::References, and clang::clangd::SymbolQualitySignals::ReservedName.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolRelevanceSignals & | S | ||
) |
Definition at line 428 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::Context, clang::clangd::SymbolRelevanceSignals::ContextWords, clang::clangd::SymbolRelevanceSignals::evaluate(), clang::clangd::SymbolRelevanceSignals::FileProximityMatch, clang::clangd::SymbolRelevanceSignals::Forbidden, clang::clangd::SymbolRelevanceSignals::HadContextType, clang::clangd::SymbolRelevanceSignals::HadSymbolType, clang::clangd::SymbolRelevanceSignals::IsInstanceMember, clang::clangd::SymbolRelevanceSignals::Name, clang::clangd::SymbolRelevanceSignals::NameMatch, clang::clangd::SymbolRelevanceSignals::NeedsFixIts, OS, clang::clangd::SymbolRelevanceSignals::Query, clang::clangd::SymbolRelevanceSignals::Scope, scopeBoost(), clang::clangd::SymbolRelevanceSignals::ScopeProximityMatch, Score, clang::clangd::SymbolRelevanceSignals::SemaFileProximityScore, clang::clangd::SymbolRelevanceSignals::SemaSaysInScope, clang::clangd::SymbolRelevanceSignals::SymbolScope, clang::clangd::SymbolRelevanceSignals::SymbolURI, clang::clangd::SymbolRelevanceSignals::TypeMatchesPreferred, uriProximity(), and wordMatching().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const TextEdit & | TE | ||
) |
Definition at line 167 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, OS, and clang::clangd::TextEdit::range.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const URIForFile & | U | ||
) |
Definition at line 80 of file Protocol.cpp.
References OS, and clang::clangd::URIForFile::uri().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
DeclRelation | R | ||
) |
Definition at line 1032 of file FindTarget.cpp.
References Alias, REL_CASE, TemplateInstantiation, TemplatePattern, and Underlying.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
DeclRelationSet | RS | ||
) |
Definition at line 1045 of file FindTarget.cpp.
References OS.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
HighlightingKind | K | ||
) |
Definition at line 362 of file SemanticHighlighting.cpp.
References Class, Concept, DependentName, DependentType, Enum, EnumConstant, Field, Function, InactiveCode, LocalVariable, Macro, Method, Namespace, OS, Parameter, Primitive, StaticField, StaticMethod, TemplateParameter, Typedef, and Variable.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
MarkupKind | K | ||
) |
Definition at line 824 of file Protocol.cpp.
References OS, and toTextKind().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
OffsetEncoding | Enc | ||
) |
Definition at line 1195 of file Protocol.cpp.
References OS, and toString().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
ReferenceLoc | R | ||
) |
Definition at line 1056 of file FindTarget.cpp.
References clang::clangd::ReferenceLoc::IsDecl, OS, printQualifiedName(), printTemplateSpecializationArgs(), clang::clangd::ReferenceLoc::Qualifier, and clang::clangd::ReferenceLoc::Targets.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
RefKind | K | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
Symbol::SymbolFlag | F | ||
) |
Definition at line 14 of file Symbol.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
SymbolOrigin | O | ||
) |
Definition at line 14 of file SymbolOrigin.cpp.
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
const CodeCompleteResult & | |||
) |
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
const CodeCompletion & | |||
) |
bool clang::clangd::operator== | ( | const HighlightingToken & | L, |
const HighlightingToken & | R | ||
) |
Definition at line 466 of file SemanticHighlighting.cpp.
References clang::clangd::HighlightingToken::Kind, and clang::clangd::HighlightingToken::R.
|
inline |
Definition at line 110 of file Hover.h.
References clang::clangd::HoverInfo::Param::Default, clang::clangd::HoverInfo::Param::Name, and clang::clangd::HoverInfo::Param::Type.
|
inline |
Definition at line 99 of file Hover.h.
References clang::clangd::HoverInfo::PassType::Converted, and clang::clangd::HoverInfo::PassType::PassBy.
Definition at line 273 of file Headers.cpp.
References clang::clangd::Inclusion::Directive, clang::clangd::Inclusion::FileKind, clang::clangd::Inclusion::HashLine, clang::clangd::Inclusion::HashOffset, clang::clangd::Inclusion::Resolved, and clang::clangd::Inclusion::Written.
bool clang::clangd::operator== | ( | const LineHighlightings & | L, |
const LineHighlightings & | R | ||
) |
Definition at line 472 of file SemanticHighlighting.cpp.
References clang::clangd::LineHighlightings::Line, and clang::clangd::LineHighlightings::Tokens.
Definition at line 96 of file Ref.h.
References clang::clangd::Ref::Kind, and clang::clangd::Ref::Location.
bool clang::clangd::operator== | ( | const SemanticToken & | L, |
const SemanticToken & | R | ||
) |
Definition at line 1013 of file Protocol.cpp.
References clang::clangd::SemanticToken::deltaLine, clang::clangd::SemanticToken::deltaStart, clang::clangd::SemanticToken::length, clang::clangd::SemanticToken::tokenModifiers, and clang::clangd::SemanticToken::tokenType.
bool clang::clangd::operator== | ( | const SymbolDetails & | LHS, |
const SymbolDetails & | RHS | ||
) |
Definition at line 645 of file Protocol.cpp.
References clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::ID, clang::clangd::SymbolDetails::name, and clang::clangd::SymbolDetails::USR.
|
inline |
Definition at line 77 of file SymbolLocation.h.
References clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, and clang::clangd::SymbolLocation::Start.
|
inline |
Definition at line 67 of file SymbolLocation.h.
References clang::clangd::SymbolLocation::Position::column(), and clang::clangd::SymbolLocation::Position::line().
Definition at line 228 of file Protocol.h.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
bool clang::clangd::operator== | ( | const TheiaSemanticHighlightingInformation & | Lhs, |
const TheiaSemanticHighlightingInformation & | Rhs | ||
) |
Definition at line 1199 of file Protocol.cpp.
References clang::clangd::TheiaSemanticHighlightingInformation::Line, and clang::clangd::TheiaSemanticHighlightingInformation::Tokens.
|
inline |
Definition at line 195 of file FindTarget.h.
|
inline |
|
inline |
|
inline |
Definition at line 31 of file SymbolOrigin.h.
|
inline |
|
inline |
|
inline |
Definition at line 35 of file SymbolOrigin.h.
|
inline |
Definition at line 201 of file FindTarget.h.
|
static |
Definition at line 46 of file Symbol.cpp.
References Strings, and visitStrings().
Referenced by clang::clangd::SymbolSlab::Builder::build(), and clang::clangd::SymbolSlab::Builder::insert().
|
static |
Definition at line 151 of file FuzzyMatch.cpp.
void clang::clangd::parseDocumentation | ( | llvm::StringRef | Input, |
markup::Document & | Output | ||
) |
void clang::clangd::parseDocumentationLine | ( | llvm::StringRef | Line, |
markup::Paragraph & | Out | ||
) |
Definition at line 1000 of file Hover.cpp.
References getBacktickQuoteRange(), Line, and Out.
llvm::Expected< PathMappings > clang::clangd::parsePathMappings | ( | llvm::StringRef | RawPathMappings | ) |
Parse the command line RawPathMappings
(e.g.
"/client=/server") into pairs. Returns an error if the mappings are malformed, i.e. not absolute or not a proper pair.
Definition at line 170 of file PathMapping.cpp.
Definition at line 102 of file GlobalCompilationDatabase.cpp.
|
static |
Definition at line 758 of file Selection.cpp.
llvm::Expected< size_t > clang::clangd::positionToOffset | ( | llvm::StringRef | Code, |
Position | P, | ||
bool | AllowColumnsBeyondLineLength = true |
||
) |
Turn a [line, column] pair into an offset in Code.
If P.character exceeds the line length, returns the offset at end-of-line. (If !AllowColumnsBeyondLineLength, then returns an error instead). If the line number is out of range, returns an error.
The returned value is in the range [0, Code.size()].
Definition at line 175 of file SourceCode.cpp.
References clang::clangd::Position::character, Code, clang::clangd::Position::line, Line, lspEncoding(), and measureUnits().
Referenced by buildRenameEdit(), clang::clangd::TweakTest::expandCases(), clang::clangd::ClangdServer::formatOnType(), and signatureHelp().
bool clang::clangd::prefer | ( | const SymbolLocation & | L, |
const SymbolLocation & | R | ||
) |
std::unique_ptr<CompilerInstance> clang::clangd::prepareCompilerInstance | ( | std::unique_ptr< clang::CompilerInvocation > | CI, |
const PrecompiledPreamble * | Preamble, | ||
std::unique_ptr< llvm::MemoryBuffer > | Buffer, | ||
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
DiagnosticConsumer & | DiagsClient | ||
) |
Definition at line 91 of file Compiler.cpp.
Referenced by clang::clangd::ParsedAST::build().
std::unique_ptr<CompilerInstance> clang::clangd::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:
MainFile
.MainFile
. llvm::Expected< std::unique_ptr< Tweak > > clang::clangd::prepareTweak | ( | StringRef | ID, |
const Tweak::Selection & | S | ||
) |
Definition at line 77 of file Tweak.cpp.
Referenced by clang::clangd::ClangdServer::applyTweak().
std::vector< std::unique_ptr< Tweak > > clang::clangd::prepareTweaks | ( | const Tweak::Selection & | S, |
llvm::function_ref< bool(const Tweak &)> | Filter | ||
) |
std::string clang::clangd::printName | ( | const ASTContext & | Ctx, |
const NamedDecl & | ND | ||
) |
Prints unqualified name of the decl for the purpose of displaying it to the user.
Anonymous decls return names of the form "(anonymous {kind})", e.g. "(anonymous struct)" or "(anonymous namespace)".
Definition at line 207 of file AST.cpp.
References Ctx, getQualifierLoc(), isAnonymous(), Name, Out, clang::tidy::bugprone::PP, and printTemplateSpecializationArgs().
std::string clang::clangd::printNamespaceScope | ( | const DeclContext & | DC | ) |
Returns the first enclosing namespace scope starting from DC
.
Definition at line 277 of file AST.cpp.
References Ctx, and printQualifiedName().
std::string clang::clangd::printQualifiedName | ( | const NamedDecl & | ND | ) |
Returns the qualified name of ND.
The scope doesn't contain unwritten scopes like inline namespaces.
Definition at line 168 of file AST.cpp.
References OS.
Referenced by operator<<(), and printNamespaceScope().
std::string clang::clangd::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>'.
Returns an empty string if decl is not a template specialization.
Definition at line 248 of file AST.cpp.
References OS.
Referenced by operator<<(), and printName().
std::string clang::clangd::printType | ( | const QualType | QT, |
const DeclContext & | CurContext | ||
) |
std::string clang::clangd::printUsingNamespaceName | ( | const ASTContext & | Ctx, |
const UsingDirectiveDecl & | D | ||
) |
llvm::Optional<std::string> clang::clangd::qualifiedByUnresolved | ( | const SourceManager & | SM, |
SourceLocation | Loc, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 195 of file clangd/IncludeFixer.cpp.
float clang::clangd::quality | ( | const Symbol & | S | ) |
Computes query-independent quality score for a Symbol.
This currently falls in the range [1, ln(#indexed documents)]. FIXME: this should probably be split into symbol -> signals and signals -> score, so it can be reused for Sema completions.
Definition at line 29 of file Symbol.cpp.
References clang::clangd::detail::log(), and clang::clangd::Symbol::References.
|
static |
Definition at line 343 of file SourceCode.cpp.
llvm::Expected< IndexFileIn > clang::clangd::readIndexFile | ( | llvm::StringRef | Data | ) |
Definition at line 657 of file Serialization.cpp.
Referenced by clang::clangd::MemoryShardStorage::loadShard().
llvm::Expected< IndexFileIn > clang::clangd::readYAML | ( | llvm::StringRef | Data | ) |
Definition at line 439 of file YAMLSerialization.cpp.
llvm::Expected< clangd::Ref > clang::clangd::refFromYAML | ( | StringRef | YAML, |
llvm::UniqueStringSaver * | Strings | ||
) |
Definition at line 543 of file YAMLSerialization.cpp.
llvm::Error clang::clangd::reformatEdit | ( | Edit & | E, |
const format::FormatStyle & | Style | ||
) |
Formats the edits and code around it according to Style.
Changes Replacements to formatted ones if succeeds.
Definition at line 1034 of file SourceCode.cpp.
::testing::Matcher<const RefSlab &> clang::clangd::RefsAre | ( | std::vector<::testing::Matcher< Ref >> | Matchers | ) |
Definition at line 37 of file BackgroundIndexTests.cpp.
Returns a version of File
that doesn't contain dots and dot dots.
e.g /a/b/../c -> /a/c /a/b/./c -> /a/b/c FIXME: We should avoid encountering such paths in clangd internals by filtering everything we get over LSP, CDB, etc.
Definition at line 114 of file FS.cpp.
Referenced by clang::clangd::OverlayCDB::getCompileCommand(), and clang::clangd::OverlayCDB::setCompileCommand().
llvm::Expected< FileEdits > clang::clangd::rename | ( | const RenameInputs & | RInputs | ) |
Renames all occurrences of the symbol.
The result edits are unformatted. If AllowCrossFile is false, returns an error if rename a symbol that's used in another file (per the index).
Definition at line 442 of file Rename.cpp.
References Tracer.
size_t clang::clangd::renameRangeAdjustmentCost | ( | ArrayRef< Range > | Indexed, |
ArrayRef< Range > | Lexed, | ||
ArrayRef< size_t > | MappedIndex | ||
) |
Evaluates how good the mapped result is.
0 indicates a perfect match.
Exposed for testing only.
REQUIRED: Indexed and Lexed are sorted, Indexed and MappedIndex have the same size.
Definition at line 685 of file Rename.cpp.
References Line.
Referenced by getMappedRanges().
|
static |
Definition at line 1840 of file CodeComplete.cpp.
|
static |
Definition at line 30 of file TestIndex.cpp.
References clang::tidy::cppcoreguidelines::join().
Referenced by addModuleDescription(), clang::pp_trace::PPCallbacksTracker::appendFilePathArgument(), ensureVaidModuleName(), Modularize::ModularizeUtilities::getCanonicalPath(), clang::tidy::llvm_check::LLVMHeaderGuardCheck::getHeaderGuard(), and sym().
std::vector<TextEdit> clang::clangd::replacementsToEdits | ( | llvm::StringRef | Code, |
const tooling::Replacements & | Repls | ||
) |
Definition at line 504 of file SourceCode.cpp.
Referenced by clang::clangd::Edit::asTextEdits().
std::vector<TextEdit> clang::clangd::replacementsToEdits | ( | StringRef | Code, |
const tooling::Replacements & | Repls | ||
) |
TextEdit clang::clangd::replacementToEdit | ( | llvm::StringRef | Code, |
const tooling::Replacement & | R | ||
) |
Definition at line 496 of file SourceCode.cpp.
References Code, and offsetToPosition().
Referenced by clang::clangd::IncludeInserter::insert().
TextEdit clang::clangd::replacementToEdit | ( | StringRef | Code, |
const tooling::Replacement & | R | ||
) |
void clang::clangd::requestShutdown | ( | ) |
Sets a flag to indicate that clangd was sent a shutdown signal, and the transport loop should exit at the next opportunity.
If shutdown was already requested, aborts the process. This function is threadsafe and signal-safe.
Definition at line 28 of file Shutdown.cpp.
References ShutdownRequested.
Referenced by main().
void clang::clangd::resolveTypeHierarchy | ( | TypeHierarchyItem & | Item, |
int | ResolveLevels, | ||
TypeHierarchyDirection | Direction, | ||
const SymbolIndex * | Index | ||
) |
Definition at line 1439 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::children, clang::clangd::TypeHierarchyItem::data, Index, and Parents.
Referenced by clang::clangd::ClangdServer::resolveTypeHierarchy().
Ret clang::clangd::retryAfterSignalUnlessShutdown | ( | const std::enable_if_t< true, Ret > & | Fail, |
const Fun & | F | ||
) |
Retry an operation if it gets interrupted by a signal.
This is like llvm::sys::RetryAfterSignal, except that if shutdown was requested (which interrupts IO), we'll fail rather than retry.
Definition at line 68 of file Shutdown.h.
void clang::clangd::runAddDocument | ( | ClangdServer & | Server, |
PathRef | File, | ||
llvm::StringRef | Contents, | ||
llvm::StringRef | Version, | ||
WantDiagnostics | WantDiags, | ||
bool | ForceRebuild | ||
) |
Definition at line 15 of file SyncAPI.cpp.
void clang::clangd::runAddDocument | ( | ClangdServer & | Server, |
PathRef | File, | ||
StringRef | Contents, | ||
StringRef | Version = "null" , |
||
WantDiagnostics | WantDiags = WantDiagnostics::Auto , |
||
bool | ForceRebuild = false |
||
) |
std::future<T> clang::clangd::runAsync | ( | llvm::unique_function< T()> | Action | ) |
Runs Action
asynchronously with a new std::thread.
The context will be propagated.
Definition at line 124 of file Threading.h.
References Action, clang::clangd::Context::clone(), Ctx, and clang::clangd::Context::current().
llvm::Expected< CodeCompleteResult > clang::clangd::runCodeComplete | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
clangd::CodeCompleteOptions | Opts | ||
) |
Definition at line 72 of file SyncAPI.cpp.
std::string clang::clangd::runDumpAST | ( | ClangdServer & | Server, |
PathRef | File | ||
) |
Definition at line 115 of file SyncAPI.cpp.
llvm::Expected< std::vector< DocumentHighlight > > clang::clangd::runFindDocumentHighlights | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos | ||
) |
Definition at line 94 of file SyncAPI.cpp.
llvm::Expected< tooling::Replacements > clang::clangd::runFormatFile | ( | ClangdServer & | Server, |
PathRef | File, | ||
StringRef | Code | ||
) |
Definition at line 109 of file SyncAPI.cpp.
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
const FuzzyFindRequest & | Req | ||
) |
Definition at line 128 of file SyncAPI.cpp.
References Builder, clang::clangd::SymbolIndex::fuzzyFind(), and Index.
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
llvm::StringRef | Query | ||
) |
Definition at line 121 of file SyncAPI.cpp.
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
StringRef | Query | ||
) |
llvm::Expected< std::vector< LocatedSymbol > > clang::clangd::runLocateSymbolAt | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos | ||
) |
Definition at line 87 of file SyncAPI.cpp.
llvm::Expected<FileEdits> clang::clangd::runRename | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
llvm::StringRef | NewName, | ||
const RenameOptions & | RenameOpts | ||
) |
Definition at line 100 of file SyncAPI.cpp.
llvm::Expected<FileEdits> clang::clangd::runRename | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
StringRef | NewName, | ||
const clangd::RenameOptions & | RenameOpts | ||
) |
llvm::Expected< std::vector< SelectionRange > > clang::clangd::runSemanticRanges | ( | ClangdServer & | Server, |
PathRef | File, | ||
const std::vector< Position > & | Pos | ||
) |
Definition at line 143 of file SyncAPI.cpp.
llvm::Expected< SignatureHelp > clang::clangd::runSignatureHelp | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos | ||
) |
Definition at line 79 of file SyncAPI.cpp.
llvm::Expected< llvm::Optional< clangd::Path > > clang::clangd::runSwitchHeaderSource | ( | ClangdServer & | Server, |
PathRef | File | ||
) |
Definition at line 151 of file SyncAPI.cpp.
|
static |
Definition at line 332 of file Quality.cpp.
References clang::clangd::ScopeDistance::distance(), and clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
|
static |
Definition at line 179 of file FileDistance.cpp.
References clang::tidy::cppcoreguidelines::join().
Referenced by clang::clangd::ScopeDistance::distance().
|
static |
Definition at line 468 of file ClangdLSPServer.cpp.
References LastKind, and toSemanticTokenType().
bool clang::clangd::shutdownRequested | ( | ) |
Checks whether requestShutdown() was called.
This function is threadsafe and signal-safe.
Definition at line 34 of file Shutdown.cpp.
References ShutdownRequested.
SignatureHelp clang::clangd::signatureHelp | ( | PathRef | FileName, |
Position | Pos, | ||
const PreambleData & | Preamble, | ||
const ParseInputs & | ParseInput | ||
) |
Get signature help at a specified Pos
in FileName
.
Definition at line 1790 of file CodeComplete.cpp.
References elog(), Offset, ParseInput, Pos, and positionToOffset().
Referenced by clang::clangd::ClangdServer::signatureHelp().
std::string clang::clangd::sortText | ( | float | Score, |
llvm::StringRef | Tiebreak = "" |
||
) |
Returns a string that sorts in the same order as (-Score, Tiebreak), for LSP.
(The highest score compares smallest so it sorts at the top).
Definition at line 485 of file Quality.cpp.
References encodeFloat(), Lower, Name, OS, and Score.
llvm::Expected< SourceLocation > clang::clangd::sourceLocationInMainFile | ( | const SourceManager & | SM, |
Position | P | ||
) |
Return the file location, corresponding to P
.
Note that one should take care to avoid comparing the result with expansion locations.
Definition at line 461 of file SourceCode.cpp.
Position clang::clangd::sourceLocToPosition | ( | const SourceManager & | SM, |
SourceLocation | Loc | ||
) |
Turn a SourceLocation into a [line, column] pair.
FIXME: This should return an error if the location is invalid.
Definition at line 220 of file SourceCode.cpp.
std::pair<llvm::StringRef, llvm::StringRef> clang::clangd::splitQualifiedName | ( | llvm::StringRef | QName | ) |
From "a::b::c", return {"a::b::", "c"}.
Scope is empty if there's no qualifier.
std::pair<StringRef, StringRef> clang::clangd::splitQualifiedName | ( | StringRef | QName | ) |
Definition at line 489 of file SourceCode.cpp.
References Pos.
Symbol clang::clangd::sym | ( | llvm::StringRef | QName, |
index::SymbolKind | Kind, | ||
llvm::StringRef | USRFormat | ||
) |
Definition at line 39 of file TestIndex.cpp.
References clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, clang::clangd::Symbol::IndexedForCodeCompletion, Kind, clang::clangd::Symbol::Name, clang::clangd::Symbol::Origin, Pos, replace(), clang::clangd::Symbol::Scope, Static, and clang::clangd::Symbol::SymInfo.
Symbol clang::clangd::symbol | ( | llvm::StringRef | QName | ) |
Definition at line 16 of file TestIndex.cpp.
References clang::clangd::Symbol::ID, clang::clangd::Symbol::Name, Pos, and clang::clangd::Symbol::Scope.
Referenced by generateSymbols().
llvm::Expected< clangd::Symbol > clang::clangd::symbolFromYAML | ( | StringRef | YAML, |
llvm::UniqueStringSaver * | Strings | ||
) |
Definition at line 532 of file YAMLSerialization.cpp.
llvm::Expected< Location > clang::clangd::symbolToLocation | ( | const Symbol & | Sym, |
llvm::StringRef | TUPath | ||
) |
Helper function for deriving an LSP Location for a Symbol.
Definition at line 63 of file FindSymbols.cpp.
References clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::Definition, and indexToLSPLocation().
Referenced by symbolToTypeHierarchyItem().
|
static |
Definition at line 1239 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::data, clang::clangd::Symbol::Deprecated, clang::clangd::TypeHierarchyItem::deprecated, clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, indexSymbolKindToSymbolKind(), clang::clangd::TypeHierarchyItem::kind, Loc, log(), clang::clangd::Symbol::Name, clang::clangd::TypeHierarchyItem::name, None, clang::clangd::TypeHierarchyItem::range, clang::clangd::TypeHierarchyItem::selectionRange, clang::clangd::SymbolID::str(), symbolToLocation(), clang::clangd::Symbol::SymInfo, and clang::clangd::TypeHierarchyItem::uri.
llvm::SmallVector< const NamedDecl *, 1 > clang::clangd::targetDecl | ( | const ast_type_traits::DynTypedNode & | , |
DeclRelationSet | Mask | ||
) |
targetDecl() finds the declaration referred to by an AST node.
For example a RecordTypeLoc refers to the RecordDecl for the type.
In some cases there are multiple results, e.g. a dependent unresolved OverloadExpr may have several candidates. All will be returned:
void foo(int); <– candidate void foo(double); <– candidate template <typename t>=""> callFoo() { foo(T()); } ^ OverloadExpr
In other cases, there may be choices about what "referred to" means. e.g. does naming a typedef refer to the underlying type? The results are marked with a set of DeclRelations, and can be filtered.
struct S{}; <– candidate (underlying) using T = S{}; <– candidate (alias) T x; ^ TypedefTypeLoc
Formally, we walk a graph starting at the provided node, and return the decls that were found. Certain edges in the graph have labels, and for each decl we return the set of labels seen on a path to the decl. For the previous example:
TypedefTypeLoc T | TypedefType T / \ [underlying] [alias] / \ RecordDecl S TypeAliasDecl T
Note that this function only returns NamedDecls. Generally other decls don't have references in this sense, just the node itself. If callers want to support such decls, they should cast the node directly.
FIXME: some AST nodes cannot be DynTypedNodes, these cannot be specified.
Definition at line 568 of file FindTarget.cpp.
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Boost | |||
) |
Definition at line 736 of file BackgroundIndexTests.cpp.
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Priority | |||
) |
Definition at line 704 of file BackgroundIndexTests.cpp.
References clang::clangd::BackgroundQueue::append(), clang::clangd::BackgroundQueue::push(), clang::clangd::BackgroundQueue::Task::QueuePri, clang::clangd::AsyncTaskRunner::runAsync(), clang::clangd::BackgroundQueue::stop(), and clang::clangd::AsyncTaskRunner::wait().
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Progress | |||
) |
Definition at line 771 of file BackgroundIndexTests.cpp.
References clang::clangd::BackgroundQueue::Stats::Active, clang::clangd::BackgroundQueue::Stats::Completed, clang::clangd::BackgroundQueue::Stats::Enqueued, clang::clangd::BackgroundQueue::Stats::LastIdle, and clang::clangd::AsyncTaskRunner::runAsync().
clang::clangd::TEST | ( | ContextTests | , |
Builders | |||
) |
Definition at line 36 of file ContextTests.cpp.
References clang::clangd::Context::derive(), clang::clangd::Context::empty(), and clang::clangd::Context::get().
clang::clangd::TEST | ( | ContextTests | , |
MoveOps | |||
) |
Definition at line 26 of file ContextTests.cpp.
References Ctx, clang::clangd::Context::derive(), clang::clangd::Context::empty(), and clang::clangd::Context::get().
clang::clangd::TEST | ( | ContextTests | , |
Simple | |||
) |
Definition at line 16 of file ContextTests.cpp.
References Ctx, clang::clangd::Context::derive(), clang::clangd::Context::empty(), and clang::clangd::Context::get().
clang::clangd::TEST_F | ( | BackgroundIndexRebuilderTest | , |
IndexingTUs | |||
) |
Definition at line 668 of file BackgroundIndexTests.cpp.
clang::clangd::TEST_F | ( | BackgroundIndexRebuilderTest | , |
LoadingShards | |||
) |
Definition at line 677 of file BackgroundIndexTests.cpp.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
CmdLineHash | |||
) |
Definition at line 586 of file BackgroundIndexTests.cpp.
References FS.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
Config | |||
) |
Definition at line 111 of file BackgroundIndexTests.cpp.
References Filename, clang::clangd::MockFS::Files, FS, Name, and testRoot().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
DirectIncludesTest | |||
) |
Definition at line 302 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
IndexTwoFiles | |||
) |
Definition at line 161 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
NoCrashOnErrorFile | |||
) |
Definition at line 92 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
NoDotsInAbsPath | |||
) |
Definition at line 492 of file BackgroundIndexTests.cpp.
References FS.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageEmptyFile | |||
) |
Definition at line 424 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageLoad | |||
) |
Definition at line 353 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageTest | |||
) |
Definition at line 231 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, FS, and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
UncompilableFiles | |||
) |
Definition at line 523 of file BackgroundIndexTests.cpp.
References FS.
clang::clangd::TEST_F | ( | ThreadingTest | , |
Memoize | |||
) |
Definition at line 66 of file ThreadingTests.cpp.
References clang::clangd::AsyncTaskRunner::runAsync().
clang::clangd::TEST_F | ( | ThreadingTest | , |
MemoizeDeterministic | |||
) |
Definition at line 95 of file ThreadingTests.cpp.
References clang::clangd::Memoize< Container >::get(), clang::clangd::Notification::notify(), clang::clangd::AsyncTaskRunner::runAsync(), clang::clangd::Notification::wait(), and clang::clangd::AsyncTaskRunner::wait().
clang::clangd::TEST_F | ( | ThreadingTest | , |
TaskRunner | |||
) |
Definition at line 19 of file ThreadingTests.cpp.
std::string clang::clangd::testPath | ( | PathRef | File, |
llvm::sys::path::Style | Style | ||
) |
Definition at line 82 of file TestFS.cpp.
Referenced by clang::clangd::TestTU::build(), clang::clangd::TestScheme::getAbsolutePath(), clang::clangd::TestTU::index(), clang::clangd::TestTU::inputs(), clang::clangd::TestTU::preamble(), and TEST_F().
const char * clang::clangd::testRoot | ( | ) |
Definition at line 74 of file TestFS.cpp.
Referenced by clang::clangd::TestScheme::getAbsolutePath(), clang::clangd::TestTU::inputs(), TEST_F(), and clang::clangd::TestScheme::uriFromAbsolutePath().
Deadline clang::clangd::timeoutSeconds | ( | llvm::Optional< double > | Seconds | ) |
Makes a deadline from a timeout in seconds. None means wait forever.
Definition at line 102 of file Threading.cpp.
References clang::clangd::Deadline::infinity().
Referenced by clang::clangd::BackgroundQueue::blockUntilIdleForTest(), and clang::clangd::ClangdServer::blockUntilIdleForTest().
CodeAction clang::clangd::toCodeAction | ( | const Fix & | F, |
const URIForFile & | File | ||
) |
Convert from Fix to LSP CodeAction.
Definition at line 370 of file Diagnostics.cpp.
llvm::Optional< SourceRange > clang::clangd::toHalfOpenFileRange | ( | const SourceManager & | Mgr, |
const LangOptions & | LangOpts, | ||
SourceRange | R | ||
) |
Turns a token range into a half-open range and checks its correctness.
The resulting range will have only valid source location on both sides, both of which are file locations.
File locations always point to a particular offset in a file, i.e. they never refer to a location inside a macro expansion. Turning locations from macro expansions into file locations is ambiguous - one can use SourceManager::{getExpansion|getFile|getSpelling}Loc. This function calls SourceManager::getFileLoc on both ends of R
to do the conversion.
User input (e.g. cursor position) is expressed as a file location, so this function can be viewed as a way to normalize the ranges used in the clang AST so that they are comparable with ranges coming from the user input.
Definition at line 428 of file SourceCode.cpp.
llvm::Expected< HeaderFile > clang::clangd::toHeaderFile | ( | llvm::StringRef | Header, |
llvm::StringRef | HintPath | ||
) |
Creates a HeaderFile
from Header
which can be either a URI or a literal include.
Definition at line 116 of file Headers.cpp.
References clang::clangd::URI::includeSpelling(), isLiteralInclude(), clang::clangd::URI::parse(), and clang::clangd::URI::resolve().
llvm::json::Value clang::clangd::toJSON | ( | const ApplyWorkspaceEditParams & | Params | ) |
Definition at line 755 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const CodeAction & | CA | ) |
Definition at line 702 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Command & | C | ) |
Definition at line 689 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionItem & | CI | ) |
Definition at line 892 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionList & | L | ) |
Definition at line 929 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Diagnostic & | D | ) |
Definition at line 531 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const DiagnosticRelatedInformation & | DRI | ) |
Definition at line 524 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentHighlight & | DH | ) |
Definition at line 985 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentLink & | DocumentLink | ) |
Definition at line 1237 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentSymbol & | S | ) |
Definition at line 719 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const FileStatus & | FStatus | ) |
Definition at line 992 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const FoldingRange & | Range | ) |
Definition at line 1249 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const FuzzyFindRequest & | Request | ) |
Definition at line 48 of file Index.cpp.
Referenced by operator<<().
llvm::json::Value clang::clangd::toJSON | ( | const Hover & | H | ) |
Definition at line 838 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Location & | P | ) |
Definition at line 138 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const MarkupContent & | MC | ) |
Definition at line 828 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const MessageType & | R | ) |
Definition at line 440 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const OffsetEncoding & | OE | ) |
Definition at line 1183 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const ParameterInformation & | PI | ) |
Definition at line 936 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Position & | P | ) |
Definition at line 111 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const ProgressParams< T > & | P | ) |
Definition at line 557 of file Protocol.h.
llvm::json::Value clang::clangd::toJSON | ( | const PublishDiagnosticsParams & | PDP | ) |
Definition at line 562 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Range & | P | ) |
Definition at line 127 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SelectionRange & | Out | ) |
Definition at line 1224 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokens & | Tokens | ) |
Definition at line 1020 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokensEdit & | Edit | ) |
Definition at line 1025 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokensOrDelta & | TE | ) |
Definition at line 1032 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const ShowMessageParams & | R | ) |
Definition at line 444 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureHelp & | SH | ) |
Definition at line 967 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureInformation & | SI | ) |
Definition at line 950 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolDetails & | P | ) |
Definition at line 650 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolInformation & | P | ) |
Definition at line 630 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TextDocumentIdentifier & | R | ) |
Definition at line 84 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TextEdit & | P | ) |
Definition at line 160 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TheiaSemanticHighlightingInformation & | Highlighting | ) |
Definition at line 1205 of file Protocol.cpp.
References clang::clangd::TheiaSemanticHighlightingInformation::IsInactive, clang::clangd::TheiaSemanticHighlightingInformation::Line, and clang::clangd::TheiaSemanticHighlightingInformation::Tokens.
llvm::json::Value clang::clangd::toJSON | ( | const TheiaSemanticHighlightingParams & | Highlighting | ) |
Definition at line 1211 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TweakArgs & | A | ) |
Definition at line 750 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TypeHierarchyItem & | I | ) |
Definition at line 1118 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const URIForFile & | U | ) |
Serialize/deserialize URIForFile
to/from a string URI.
Definition at line 78 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const VersionedTextDocumentIdentifier & | R | ) |
Definition at line 93 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressBegin & | P | ) |
Definition at line 406 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressCreateParams & | P | ) |
Definition at line 402 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressEnd & | P | ) |
Definition at line 432 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressReport & | P | ) |
Definition at line 420 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkspaceEdit & | WE | ) |
Definition at line 735 of file Protocol.cpp.
void clang::clangd::toLSPDiags | ( | const Diag & | D, |
const URIForFile & | File, | ||
const ClangdDiagnosticOptions & | Opts, | ||
llvm::function_ref< void(clangd::Diagnostic, llvm::ArrayRef< Fix > | |||
) |
Conversion to LSP diagnostics.
Formats the error message of each diagnostic to include all its notes. Notes inside main file are also provided as separate diagnostics with their corresponding fixits. Notes outside main file do not have a corresponding LSP diagnostic, but can still be included as part of their main diagnostic's message.
Definition at line 380 of file Diagnostics.cpp.
|
static |
Definition at line 30 of file Annotations.cpp.
References Code, clang::clangd::Range::end, offsetToPosition(), and clang::clangd::Range::start.
Referenced by clang::clangd::Annotations::range(), and clang::clangd::Annotations::ranges().
std::vector< SemanticToken > clang::clangd::toSemanticTokens | ( | llvm::ArrayRef< HighlightingToken > | Tokens | ) |
Definition at line 477 of file SemanticHighlighting.cpp.
llvm::StringRef clang::clangd::toSemanticTokenType | ( | HighlightingKind | Kind | ) |
Definition at line 509 of file SemanticHighlighting.cpp.
References Kind.
Referenced by semanticTokenTypes().
llvm::StringRef clang::clangd::toSourceCode | ( | const SourceManager & | SM, |
SourceRange | R | ||
) |
Returns the source code covered by the source range.
EXPECTS: isValidFileRange(R) == true.
Definition at line 450 of file SourceCode.cpp.
|
static |
Definition at line 1170 of file Protocol.cpp.
References UnsupportedEncoding, UTF16, UTF32, and UTF8.
Referenced by operator<<().
TextEdit clang::clangd::toTextEdit | ( | const FixItHint & | FixIt, |
const SourceManager & | M, | ||
const LangOptions & | L | ||
) |
Definition at line 551 of file SourceCode.cpp.
|
static |
Definition at line 797 of file Protocol.cpp.
References Kind, Markdown, and PlainText.
Referenced by operator<<().
llvm::StringRef clang::clangd::toTextMateScope | ( | HighlightingKind | Kind | ) |
Converts a HighlightingKind to a corresponding TextMate scope (https://manual.macromates.com/en/language_grammars).
Definition at line 584 of file SemanticHighlighting.cpp.
References Kind.
std::vector< TheiaSemanticHighlightingInformation > clang::clangd::toTheiaSemanticHighlightingInformation | ( | llvm::ArrayRef< LineHighlightings > | Tokens | ) |
Convert to LSP's semantic highlighting information.
Definition at line 555 of file SemanticHighlighting.cpp.
|
static |
Definition at line 316 of file SourceCode.cpp.
std::string clang::clangd::toYAML | ( | const Ref & | R | ) |
Definition at line 520 of file YAMLSerialization.cpp.
std::string clang::clangd::toYAML | ( | const Relation & | R | ) |
Definition at line 509 of file YAMLSerialization.cpp.
Definition at line 498 of file YAMLSerialization.cpp.
std::string clang::clangd::toYAML | ( | const Symbol & | S | ) |
Definition at line 487 of file YAMLSerialization.cpp.
unsigned clang::clangd::transformCursorPosition | ( | unsigned | Offset, |
const std::vector< tooling::Replacement > & | Replacements | ||
) |
Determine the new cursor position after applying Replacements
.
Analogue of tooling::Replacements::getShiftedCodePosition().
Definition at line 353 of file Format.cpp.
SourceLocation clang::clangd::translatePreamblePatchLocation | ( | SourceLocation | Loc, |
const SourceManager & | SM | ||
) |
Translates locations inside preamble patch to their main-file equivalent using presumed locations.
Returns Loc
if it isn't inside preamble patch.
Definition at line 536 of file Preamble.cpp.
|
static |
Definition at line 435 of file ClangdServer.cpp.
Referenced by clang::clangd::ClangdServer::applyTweak(), and clang::clangd::ClangdServer::enumerateTweaks().
std::vector< const CXXRecordDecl * > clang::clangd::typeParents | ( | const CXXRecordDecl * | CXXRD | ) |
|
static |
Definition at line 325 of file SourceCode.cpp.
|
static |
Definition at line 37 of file DraftStore.cpp.
References log(), and clang::clangd::DraftStore::Draft::Version.
Referenced by clang::clangd::DraftStore::addDraft().
|
static |
Definition at line 323 of file Quality.cpp.
References clang::clangd::URIDistance::distance().
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
Symbol clang::clangd::var | ( | llvm::StringRef | Name | ) |
Definition at line 68 of file TestIndex.cpp.
std::vector< std::string > clang::clangd::visibleNamespaces | ( | llvm::StringRef | Code, |
const LangOptions & | LangOpts | ||
) |
Heuristically determine namespaces visible at a point, without parsing Code.
This considers using-directives and enclosing namespace-declarations that are visible (and not obfuscated) in the file itself (not headers). Code should be truncated at the point of interest.
The returned vector is always non-empty.
Using directives are resolved against all enclosing scopes, but no other namespace directives.
example: using namespace a; namespace foo { using namespace b;
visibleNamespaces are {"foo::", "", "a::", "b::", "foo::b::"}, not "a::b::".
Definition at line 792 of file SourceCode.cpp.
Invokes Callback with each StringRef& contained in the Symbol.
Useful for deduplicating backing strings.
Definition at line 147 of file Symbol.h.
References clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::CompletionSnippetSuffix, clang::clangd::Symbol::Definition, clang::clangd::Symbol::Documentation, clang::clangd::SymbolLocation::FileURI, clang::clangd::Symbol::IncludeHeaders, clang::clangd::Symbol::Name, clang::clangd::Symbol::ReturnType, clang::clangd::Symbol::Scope, clang::clangd::Symbol::Signature, clang::clangd::Symbol::TemplateSpecializationArgs, and clang::clangd::Symbol::Type.
Referenced by own().
void clang::clangd::vlog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 67 of file Logger.h.
References clang::clangd::detail::log(), and clang::clangd::Logger::Verbose.
Referenced by getMappedRanges(), and clang::clangd::FileIndex::updateMain().
void clang::clangd::wait | ( | std::unique_lock< std::mutex > & | Lock, |
std::condition_variable & | CV, | ||
Deadline | D | ||
) |
Wait once on CV for the specified duration.
Definition at line 110 of file Threading.cpp.
References clang::clangd::Deadline::infinity(), clang::clangd::Deadline::time(), and clang::clangd::Deadline::zero().
Referenced by clang::clangd::BackgroundQueue::blockUntilIdleForTest(), and clang::clangd::AsyncTaskRunner::wait().
LLVM_NODISCARD bool clang::clangd::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.
Definition at line 92 of file Threading.h.
|
static |
Definition at line 343 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
|
static |
Sanitizes a piece for presenting it in a synthesized fix message.
Ensures the result is not too large and does not contain newlines.
Definition at line 532 of file Diagnostics.cpp.
void clang::clangd::writeYAML | ( | const IndexFileOut & | O, |
llvm::raw_ostream & | OS | ||
) |
Definition at line 406 of file YAMLSerialization.cpp.
References OS, Output, clang::clangd::IndexFileOut::Refs, clang::clangd::IndexFileOut::Relations, clang::clangd::IndexFileOut::Sources, and clang::clangd::IndexFileOut::Symbols.
Referenced by operator<<().
|
static |
Referenced by main().
llvm::json::Value clang::clangd::xpcToJson | ( | const xpc_object_t & | XPCObject | ) |
Definition at line 26 of file Conversion.cpp.
|
staticconstexpr |
Definition at line 72 of file FuzzyMatch.cpp.
Referenced by isAwful().
|
staticconstexpr |
Definition at line 141 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
|
staticconstexpr |
Definition at line 114 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
|
constexpr |
Definition at line 312 of file Protocol.h.
|
constexpr |
Definition at line 310 of file Protocol.h.
Referenced by adjustKindToCapability().
Key< OffsetEncoding > clang::clangd::kCurrentOffsetEncoding |
Definition at line 144 of file SourceCode.cpp.
Referenced by lspEncoding().
|
static |
Definition at line 98 of file TUScheduler.cpp.
Referenced by clang::clangd::TUScheduler::getFileBeingProcessedInContext().
|
constexpr |
The maximum number of path components in a key from StdSuffixHeaderMapping.
Used to minimize the number of lookups in suffix path mappings.
Definition at line 29 of file CanonicalIncludes.cpp.
|
staticconstexpr |
Definition at line 74 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::match().
|
static |
Definition at line 15 of file BackgroundQueue.cpp.
Referenced by clang::clangd::BackgroundQueue::preventThreadStarvationInTests(), and clang::clangd::BackgroundQueue::work().
|
constexpr |
Definition at line 999 of file Protocol.cpp.
|
static |
Definition at line 26 of file Shutdown.cpp.
Referenced by requestShutdown(), and shutdownRequested().
|
static |
Definition at line 22 of file Cancellation.cpp.
Referenced by cancelableTask(), and isCancelled().
|
constexpr |
Definition at line 351 of file Protocol.h.
|
constexpr |
Definition at line 350 of file Protocol.h.
Referenced by adjustKindToCapability().
|
static |
Definition at line 19 of file URITests.cpp.
|
static |
Definition at line 36 of file QualityTests.cpp.
volatile int clang::clangd::UnittestSchemeAnchorSource = 0 |
Definition at line 132 of file TestFS.cpp.