clang-tools 22.0.0git
|
FIXME: Skip testing on windows temporarily due to the different escaping code mode. More...
Namespaces | |
namespace | config |
namespace | detail |
namespace | dex |
namespace | markup |
namespace | remote |
namespace | riff |
namespace | trace |
Classes | |
struct | Anchor |
class | Annotations |
Same as llvm::Annotations, but adjusts functions to LSP-specific types for positions and ranges. More... | |
struct | ApplyWorkspaceEditParams |
struct | ApplyWorkspaceEditResponse |
class | ArgStripper |
struct | ASTAction |
struct | ASTNode |
Simplified description of a clang AST node. More... | |
struct | ASTParams |
Payload for textDocument/ast request. More... | |
struct | ASTRetentionPolicy |
Configuration of the AST retention policy. More... | |
struct | ASTSignals |
Signals derived from a valid AST of a file. More... | |
class | AsyncTaskRunner |
Runs tasks on separate (detached) threads and wait for all tasks to finish. More... | |
class | BackgroundIndex |
class | BackgroundIndexRebuilder |
class | BackgroundIndexRebuilderTest |
class | BackgroundIndexStorage |
class | BackgroundIndexTest |
class | BackgroundQueue |
class | BlockCommentToMarkupDocument |
struct | CallHierarchyIncomingCall |
Represents an incoming call, e.g. a caller of a method or constructor. More... | |
struct | CallHierarchyIncomingCallsParams |
The parameter of a callHierarchy/incomingCalls request. More... | |
struct | CallHierarchyItem |
Represents programming constructs like functions or constructors in the context of call hierarchy. More... | |
struct | CallHierarchyOutgoingCall |
Represents an outgoing call, e.g. More... | |
struct | CallHierarchyOutgoingCallsParams |
The parameter of a callHierarchy/outgoingCalls request. More... | |
struct | CallHierarchyPrepareParams |
The parameter of a textDocument/prepareCallHierarchy request. More... | |
class | CancelledError |
Conventional error when no result is returned due to cancellation. More... | |
struct | CancelState |
class | CanonicalIncludes |
Maps a definition location onto an #include file, based on a set of filename rules. More... | |
struct | CapturedASTCtx |
The captured AST context. More... | |
struct | ChangeAnnotation |
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 | CodeDescription |
Structure to capture a description for an error code. More... | |
class | CollectMainFileMacros |
Collects macro references (e.g. More... | |
class | CollectPragmaMarks |
struct | Command |
struct | CommandMangler |
struct | CompletionContext |
struct | CompletionItem |
struct | CompletionItemLabelDetails |
Additional details for a completion item label. More... | |
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... | |
struct | ContainedRefsRequest |
struct | ContainedRefsResult |
class | Context |
A context is an immutable container for per-request data that must be propagated through layers that don't care about it. More... | |
class | Deadline |
A point in time we can wait for. More... | |
struct | DebouncePolicy |
Clangd may wait after an update to see if another one comes along. More... | |
struct | DecisionForestScores |
Same semantics as CodeComplete::Score. More... | |
class | DeclRelationSet |
struct | DefinedMacro |
class | DelegatingCDB |
struct | Diag |
A top-level diagnostic that may have Notes and Fixes. More... | |
struct | DiagBase |
Contains basic information about a diagnostic. More... | |
struct | Diagnostic |
struct | DiagnosticRelatedInformation |
Represents a related message and source code location for a diagnostic. More... | |
struct | DidChangeConfigurationParams |
struct | DidChangeTextDocumentParams |
struct | DidChangeWatchedFilesParams |
struct | DidCloseTextDocumentParams |
struct | DidOpenTextDocumentParams |
struct | DidSaveTextDocumentParams |
class | DirectoryBasedGlobalCompilationDatabase |
Gets compile args from tooling::CompilationDatabases built for parent directories. More... | |
class | DirectoryBasedGlobalCompilationDatabaseCacheTest |
struct | DocumentFormattingParams |
struct | DocumentHighlight |
A document highlight is a range inside a text document which deserves special attention. More... | |
struct | DocumentLink |
A range in a text document that links to an internal or external resource, like another text document or a web site. More... | |
struct | DocumentLinkParams |
Parameters for the document link request. More... | |
struct | DocumentOnTypeFormattingParams |
struct | DocumentRangeFormattingParams |
struct | DocumentRangesFormattingParams |
struct | DocumentSymbol |
Represents programming constructs like variables, classes, interfaces etc. More... | |
struct | DocumentSymbolParams |
class | DraftStore |
A thread-safe container for files opened in a workspace, addressed by filenames. More... | |
struct | Edit |
A set of edits generated for a single file. More... | |
struct | EligibleRegion |
Represents locations that can accept a definition. More... | |
class | Event |
An Event<T> allows events of type T to be broadcast to listeners. More... | |
struct | ExecuteCommandParams |
class | FeatureModule |
A FeatureModule contributes a vertical feature to clangd. More... | |
class | FeatureModuleSet |
A FeatureModuleSet is a collection of feature modules installed in clangd. More... | |
class | FileCache |
Base class for threadsafe cache of data read from a file on disk. More... | |
class | FileDistance |
struct | FileDistanceOptions |
struct | FileEvent |
class | FileIndex |
This manages symbols from files and an in-memory index on all symbols. More... | |
struct | FileShardedIndex |
Takes slabs coming from a TU (multiple files) and shards them per declaration location. More... | |
struct | FileStatus |
Clangd extension: indicates the current state of the file in clangd, sent from server via the textDocument/clangd.fileStatus notification. More... | |
class | FileSymbols |
A container of slabs associated with a key. More... | |
struct | Fix |
Represents a single fix-it that editor can apply to fix the error. More... | |
struct | FoldingRange |
Stores information about a region of code that can be folded. More... | |
struct | FoldingRangeParams |
struct | FuzzyFindRequest |
class | FuzzyMatcher |
class | GlobalCompilationDatabase |
Provides compilation arguments used for parsing C and C++ files. More... | |
struct | HeaderFile |
Represents a header file to be #include'd. More... | |
struct | HighlightingToken |
struct | Hover |
struct | HoverInfo |
Contains detailed information about a Symbol. More... | |
class | IgnoreDiagnostics |
struct | InactiveRegionsParams |
Parameters for the inactive regions (server-side) push notification. More... | |
struct | IncludeCleanerFindings |
class | IncludeFixer |
Attempts to recover from error diagnostics by suggesting include insertion fixes. More... | |
struct | IncludeGraphNode |
class | IncludeInserter |
class | IncludeStructure |
struct | Inclusion |
struct | IndexFileIn |
struct | IndexFileOut |
struct | InitializationOptions |
Clangd extension: parameters configurable at initialize time. More... | |
struct | InitializeParams |
struct | InlayHint |
Inlay hint information. More... | |
struct | InlayHintLabelPart |
An inlay hint label part allows for interactive and composite labels of inlay hints. More... | |
struct | InlayHintOptions |
struct | InlayHintsParams |
A parameter literal used in inlay hint requests. More... | |
struct | InputsAndAST |
struct | InputsAndPreamble |
class | Key |
Values in a Context are indexed by typed keys. More... | |
struct | LoadedShard |
Represents a shard loaded from storage, stores contents in Shard and metadata about the source file that generated this shard. More... | |
struct | LocatedSymbol |
struct | Location |
class | Logger |
Interface to allow custom logging in clangd. More... | |
class | LoggingSession |
Only one LoggingSession can be active at a time. More... | |
struct | LookupRequest |
class | LSPBinder |
LSPBinder collects a table of functions that handle LSP calls. More... | |
class | LSPClient |
class | LSPError |
struct | MacroOccurrence |
struct | MainFileMacros |
struct | MarkupContent |
class | MemIndex |
MemIndex is a naive in-memory index suitable for a small set of symbols. More... | |
class | Memoize |
Memoize is a cache to store and reuse computation results based on a key. More... | |
class | MemoryShardStorage |
struct | MemoryTree |
A tree that can be used to represent memory usage of nested components while preserving the hierarchy. More... | |
class | MergedIndex |
struct | MissingIncludeDiagInfo |
class | MockCompilationDatabase |
class | MockFS |
class | ModulesBuilder |
This class handles building module files for a given source file. More... | |
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 | OverlayCDB |
Wraps another compilation database, and supports overriding the commands using an in-memory mapping. More... | |
class | ParagraphToMarkupDocument |
class | ParagraphToString |
struct | ParameterInformation |
A single parameter of a particular signature. More... | |
class | ParsedAST |
Stores and provides access to parsed AST. More... | |
struct | ParseInputs |
Information required to run clang, e.g. to parse AST or do code completion. More... | |
struct | ParseOptions |
class | ParsingCallbacks |
struct | PathMapping |
PathMappings are a collection of paired client and server paths. More... | |
class | PeriodicThrottler |
Used to guard an operation that should run at most every N seconds. More... | |
class | PolySubsequenceMatcher |
struct | Position |
struct | PragmaMark |
Represents a #pragma mark in the main file. More... | |
struct | PreambleBuildStats |
Timings and statistics from the premble build. More... | |
struct | PreambleData |
The parsed preamble and associated data. More... | |
class | PreambleFileStatusCache |
Records status information for files open()ed or stat()ed during preamble build (except for the main file), so we can avoid stat()s on the underlying FS when reusing the preamble. More... | |
class | PreamblePatch |
Stores information required to parse a TU using a (possibly stale) Baseline preamble. More... | |
class | PreambleThrottler |
PreambleThrottler controls which preambles can build at any given time. More... | |
struct | PrepareRenameResult |
class | PrerequisiteModules |
Store all the needed module files information to parse a single source file. More... | |
struct | ProgressParams |
struct | ProjectInfo |
class | ProjectModules |
An interface to query the modules information in the project. More... | |
struct | PublishDiagnosticsParams |
struct | Range |
class | RealThreadsafeFS |
struct | Ref |
Represents a symbol occurrence in the source file. More... | |
struct | ReferenceContext |
struct | ReferenceLoc |
Information about a reference written in the source code, independent of the actual AST node that this reference lives in. More... | |
struct | ReferenceLocation |
Extends Locations returned by textDocument/references with extra info. More... | |
struct | ReferenceParams |
struct | ReferencesResult |
class | RefSlab |
An efficient structure of storing large set of symbol references in memory. More... | |
struct | RefsRequest |
struct | Relation |
Represents a relation between two symbols. More... | |
class | RelationSlab |
struct | RelationsRequest |
struct | RenameInputs |
struct | RenameOptions |
struct | RenameParams |
struct | RenameResult |
class | RenameSymbolName |
A name of a symbol that should be renamed. More... | |
struct | ResolveTypeHierarchyItemParams |
Parameters for the typeHierarchy/resolve request. More... | |
class | ScanningAllProjectModules |
TODO: The existing ScanningAllProjectModules is not efficient. More... | |
class | ScopeDistance |
Support lookups like FileDistance, but the lookup keys are symbol scopes. More... | |
struct | SelectionRange |
struct | SelectionRangeParams |
class | SelectionTree |
struct | SemanticToken |
Specifies a single semantic token in the document. More... | |
struct | SemanticTokens |
A versioned set of tokens. More... | |
struct | SemanticTokensDeltaParams |
Body of textDocument/semanticTokens/full/delta request. More... | |
struct | SemanticTokensEdit |
Describes a replacement of a contiguous range of semanticTokens. More... | |
struct | SemanticTokensOrDelta |
This models LSP SemanticTokensDelta | SemanticTokens, which is the result of textDocument/semanticTokens/full/delta. More... | |
struct | SemanticTokensParams |
Body of textDocument/semanticTokens/full request. More... | |
class | Semaphore |
Limits the number of threads that can acquire the lock at the same time. More... | |
struct | ShowMessageParams |
The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface. More... | |
struct | SignatureHelp |
Represents the signature of a callable. More... | |
struct | SignatureInformation |
Represents the signature of something callable. More... | |
struct | SignatureQualitySignals |
struct | SourceParams |
struct | SpelledWord |
struct | StdLibLocation |
class | StdLibSet |
class | StoreDiags |
StoreDiags collects the diagnostics that can later be reported by clangd. More... | |
class | StreamLogger |
class | SubsequenceMatcher |
class | SwapIndex |
struct | Symbol |
The class presents a C++ symbol, e.g. More... | |
class | SymbolCollector |
Collect declarations (symbols) from an AST. More... | |
struct | SymbolDetails |
Represents information about identifier. More... | |
class | SymbolDocCommentVisitor |
class | SymbolID |
struct | SymbolInclude |
A header and directives as stored in a Symbol. More... | |
class | SymbolIndex |
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbols based on names or unique IDs. More... | |
struct | SymbolInformation |
Represents information about programming constructs like variables, classes, interfaces etc. More... | |
struct | SymbolLocation |
struct | SymbolQualitySignals |
Attributes of a symbol that affect how much we like it. More... | |
struct | SymbolRange |
Represents a symbol range where the symbol can potentially have multiple tokens. More... | |
struct | SymbolRelevanceSignals |
Attributes of a symbol-query pair that affect how much we like it. More... | |
class | SymbolSlab |
An immutable symbol container that stores a set of symbols. More... | |
class | TestScheme |
unittest: is a scheme that refers to files relative to testRoot(). More... | |
struct | TestTU |
class | TestWorkspace |
struct | TextDocumentContentChangeEvent |
struct | TextDocumentEdit |
struct | TextDocumentIdentifier |
struct | TextDocumentItem |
struct | TextDocumentPositionParams |
struct | TextEdit |
class | ThreadCrashReporter |
Allows setting per-thread abort/kill signal callbacks, to print additional information about the crash depending on which thread got signalled. More... | |
class | ThreadingTest |
class | ThreadsafeFS |
Wrapper for vfs::FileSystem for use in multithreaded programs like clangd. More... | |
struct | Token |
A single C++ or preprocessor token. More... | |
class | TokenStream |
A complete sequence of Tokens representing a source file. More... | |
class | TopN |
TopN<T> is a lossy container that preserves only the "best" N elements. More... | |
class | Transport |
class | TraverseHeadersToo |
class | TUScheduler |
Handles running tasks for ClangdServer and managing the resources (e.g., preambles and ASTs) for opened files. More... | |
struct | TUStatus |
class | Tweak |
An interface base for small context-sensitive refactoring actions. More... | |
struct | TweakArgs |
Arguments for the 'applyTweak' command. More... | |
class | TweakTest |
struct | TypeHierarchyItem |
struct | TypeHierarchyPrepareParams |
The type hierarchy params is an extension of the TextDocumentPositionsParams with optional properties which can be used to eagerly resolve the item when requesting from the server. More... | |
class | URI |
A URI describes the location of a source file. More... | |
class | URIDistance |
struct | URIForFile |
class | URIScheme |
URIScheme is an extension point for teaching clangd to recognize a custom URI scheme. More... | |
struct | VersionedTextDocumentIdentifier |
class | WithContext |
WithContext replaces Context::current() with a provided scope. More... | |
class | WithContextValue |
WithContextValue extends Context::current() with a single value. More... | |
struct | WorkDoneProgressBegin |
To start progress reporting a $/progress notification with the following payload must be sent. More... | |
struct | WorkDoneProgressCreateParams |
struct | WorkDoneProgressEnd |
Signals the end of progress reporting. More... | |
struct | WorkDoneProgressReport |
Reporting progress is done using the following payload. More... | |
struct | WorkspaceEdit |
The edit should either provide changes or documentChanges. More... | |
struct | WorkspaceSymbolParams |
The parameters of a Workspace Symbol Request. More... |
Typedefs | |
using | CharTypeSet = unsigned char |
using | SystemIncludeExtractorFn |
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags. | |
using | HeaderFilter = llvm::ArrayRef<std::function<bool(llvm::StringRef)>> |
using | IncludeGraph = llvm::StringMap<IncludeGraphNode> |
using | SlabTuple = std::tuple<SymbolSlab, RefSlab, RelationSlab> |
using | IndexFactory |
A functor to create an index for an external index specification. | |
using | PathMappings = std::vector<PathMapping> |
using | PreambleParsedCallback |
using | ChangeAnnotationIdentifier = std::string |
using | InitializedParams = NoParams |
using | CompletionItemKindBitset = std::bitset<CompletionItemKindMax + 1> |
using | SymbolKindBitset = std::bitset<SymbolKindMax + 1> |
typedef llvm::Registry< Tweak > | TweakRegistry |
A handy typedef to save some typing. | |
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. | |
using | Canceler = std::function<void()> |
A canceller requests cancellation of a task, when called. | |
template<typename T> | |
using | Callback = llvm::unique_function<void(llvm::Expected<T>)> |
A Callback<T> is a void function that accepts Expected<T>. | |
using | Path = std::string |
A typedef to represent a file path. | |
using | PathRef = llvm::StringRef |
A typedef to represent a ref to file path. | |
using | TidyProvider |
A factory to modify a tidy::ClangTidyOptions. | |
using | TidyProviderRef |
A factory to modify a tidy::ClangTidyOptions that doesn't hold any state. | |
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. | |
using | RecursionProtectionSet = llvm::SmallPtrSet<const CXXRecordDecl *, 4> |
Enumerations | |
enum class | DeclRelation : unsigned { TemplateInstantiation , TemplatePattern , Alias , Underlying } |
enum | CharType : unsigned char { Empty = 0 , Lower = 1 , Upper = 2 , Punctuation = 3 } |
enum | CharRole : unsigned char { Unknown = 0 , Tail = 1 , Head = 2 , Separator = 3 } |
enum class | IndexType { Light , Heavy } |
Select between in-memory index implementations, which have tradeoffs. More... | |
enum class | DuplicateHandling { PickOne , Merge } |
How to handle duplicated symbols across multiple files. More... | |
enum class | IndexContents : uint8_t { None = 0 , Symbols = 1 << 1 , References = 1 << 2 , Relations = 1 << 3 , All = Symbols | References | Relations } |
Describes what data is covered by an index. More... | |
enum class | RefKind : uint8_t { Unknown = 0 , Declaration = 1 << 0 , Definition = 1 << 1 , Reference = 1 << 2 , Spelled = 1 << 3 , Call = 1 << 4 , All = Declaration | Definition | Reference | Spelled } |
Describes the kind of a cross-reference. More... | |
enum class | RelationKind : uint8_t { BaseOf , OverriddenBy } |
enum class | IndexFileFormat { RIFF , YAML } |
enum class | SymbolOrigin : uint16_t { Unknown = 0 , AST = 1 << 0 , Open = 1 << 1 , Static = 1 << 2 , Merge = 1 << 3 , Identifier = 1 << 4 , Remote = 1 << 5 , Preamble = 1 << 6 , Background = 1 << 8 , StdLib = 1 << 9 } |
enum class | ErrorCode { ParseError = -32700 , InvalidRequest = -32600 , MethodNotFound = -32601 , InvalidParams = -32602 , InternalError = -32603 , ServerNotInitialized = -32002 , UnknownErrorCode = -32001 , RequestCancelled = -32800 , ContentModified = -32801 } |
enum class | TraceLevel { Off = 0 , Messages = 1 , Verbose = 2 } |
enum class | TextDocumentSyncKind { None = 0 , Full = 1 , Incremental = 2 } |
Defines how the host (editor) should sync document changes to the language server. More... | |
enum class | CompletionItemKind { Missing = 0 , Text = 1 , Method = 2 , Function = 3 , Constructor = 4 , Field = 5 , Variable = 6 , Class = 7 , Interface = 8 , Module = 9 , Property = 10 , Unit = 11 , Value = 12 , Enum = 13 , Keyword = 14 , Snippet = 15 , Color = 16 , File = 17 , Reference = 18 , Folder = 19 , EnumMember = 20 , Constant = 21 , Struct = 22 , Event = 23 , Operator = 24 , TypeParameter = 25 } |
The kind of a completion entry. More... | |
enum class | SymbolKind { File = 1 , Module = 2 , Namespace = 3 , Package = 4 , Class = 5 , Method = 6 , Property = 7 , Field = 8 , Constructor = 9 , Enum = 10 , Interface = 11 , Function = 12 , Variable = 13 , Constant = 14 , String = 15 , Number = 16 , Boolean = 17 , Array = 18 , Object = 19 , Key = 20 , Null = 21 , EnumMember = 22 , Struct = 23 , Event = 24 , Operator = 25 , TypeParameter = 26 } |
A symbol kind. More... | |
enum class | OffsetEncoding { UnsupportedEncoding , UTF16 , UTF8 , UTF32 } |
enum class | MarkupKind { PlainText , Markdown } |
enum class | MessageType { Error = 1 , Warning = 2 , Info = 3 , Log = 4 } |
enum class | FileChangeType { Created = 1 , Changed = 2 , Deleted = 3 } |
enum | DiagnosticTag { Unnecessary = 1 , Deprecated = 2 } |
enum class | CompletionTriggerKind { Invoked = 1 , TriggerCharacter = 2 , TriggerTriggerForIncompleteCompletions = 3 } |
enum class | InsertTextFormat { Missing = 0 , PlainText = 1 , Snippet = 2 } |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet. More... | |
enum class | DocumentHighlightKind { Text = 1 , Read = 2 , Write = 3 } |
enum class | TypeHierarchyDirection { Children = 0 , Parents = 1 , Both = 2 } |
enum class | SymbolTag { Deprecated = 1 } |
enum class | InlayHintKind { Type = 1 , Parameter = 2 , Designator = 3 , BlockEnd = 4 , DefaultArgument = 6 } |
Inlay hint kinds. More... | |
enum class | HighlightingKind { Variable = 0 , LocalVariable , Parameter , Function , Method , StaticMethod , Field , StaticField , Class , Interface , Enum , EnumConstant , Typedef , Type , Unknown , Namespace , TemplateParameter , Concept , Primitive , Macro , Modifier , Operator , Bracket , Label , InactiveCode , LastKind = InactiveCode } |
enum class | HighlightingModifier { Declaration , Definition , Deprecated , Deduced , Readonly , Static , Abstract , Virtual , DependentName , DefaultLibrary , UsedAsMutableReference , UsedAsMutablePointer , ConstructorOrDestructor , UserDefined , FunctionScope , ClassScope , FileScope , GlobalScope , LastModifier = GlobalScope } |
enum class | LexFlags : uint8_t { StartsPPLine = 1 << 0 , NeedsCleaning = 1 << 1 } |
enum class | ErrorResultCode : int { NoShutdownRequest = 1 , CantRunAsXPCService = 2 , CheckFailed = 3 } |
enum | JSONStreamStyle { Standard , Delimited } |
enum class | WantDiagnostics { Yes , No , Auto } |
Determines whether diagnostics should be generated for a file snapshot. More... | |
enum class | PreambleAction { Queued , Building , Idle } |
Functions | |
bool | isImplicitTemplateInstantiation (const NamedDecl *D) |
Indicates if D is a template instantiation implicitly generated by the compiler, e.g. | |
bool | isExplicitTemplateSpecialization (const NamedDecl *D) |
Indicates if D is an explicit template specialization, e.g. | |
bool | isImplementationDetail (const Decl *D) |
Returns true if the declaration is considered implementation detail based on heuristics. | |
SourceLocation | nameLocation (const clang::Decl &D, const SourceManager &SM) |
Find the source location of the identifier for D . | |
std::string | printQualifiedName (const NamedDecl &ND) |
Returns the qualified name of ND. | |
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. | |
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. | |
std::string | printName (const ASTContext &Ctx, const NamedDecl &ND) |
Prints unqualified name of the decl for the purpose of displaying it to the user. | |
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>'. | |
std::string | printNamespaceScope (const DeclContext &DC) |
Returns the first enclosing namespace scope starting from DC . | |
static llvm::StringRef | getNameOrErrForObjCInterface (const ObjCInterfaceDecl *ID) |
std::string | printObjCMethod (const ObjCMethodDecl &Method) |
Print the Objective-C method name, including the full container name, e.g. | |
std::string | printObjCContainer (const ObjCContainerDecl &C) |
Print the Objective-C container name including categories, e.g. MyClass,. | |
SymbolID | getSymbolID (const Decl *D) |
Gets the symbol ID for a declaration. Returned SymbolID might be null. | |
SymbolID | getSymbolID (const llvm::StringRef MacroName, const MacroInfo *MI, const SourceManager &SM) |
Gets the symbol ID for a macro. | |
const ObjCImplDecl * | getCorrespondingObjCImpl (const ObjCContainerDecl *D) |
Return the corresponding implementation/definition for the given ObjC container if it has one, otherwise, return nullptr. | |
Symbol::IncludeDirective | preferredIncludeDirective (llvm::StringRef FileName, const LangOptions &LangOpts, ArrayRef< Inclusion > MainFileIncludes, ArrayRef< const Decl * > TopLevelDecls) |
Infer the include directive to use for the given FileName . | |
std::string | printType (const QualType QT, const DeclContext &CurContext, llvm::StringRef Placeholder="", bool FullyQualify=false) |
Returns a QualType as string. | |
bool | hasReservedName (const Decl &) |
Returns true if this is a NamedDecl with a reserved name. | |
bool | hasReservedScope (const DeclContext &) |
Returns true if this scope would be written with a reserved name. | |
QualType | declaredType (const TypeDecl *D) |
std::optional< QualType > | getDeducedType (ASTContext &, SourceLocation Loc) |
Retrieves the deduced type at a given location (auto, decltype). | |
TemplateTypeParmTypeLoc | getContainedAutoParamType (TypeLoc TL) |
template<typename TemplateDeclTy> | |
static NamedDecl * | getOnlyInstantiationImpl (TemplateDeclTy *TD) |
NamedDecl * | getOnlyInstantiation (NamedDecl *TemplatedDecl) |
std::vector< const Attr * > | getAttributes (const DynTypedNode &) |
Return attributes attached directly to a node. | |
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 . | |
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. | |
bool | hasUnstableLinkage (const Decl *D) |
Whether we must avoid computing linkage for D during code completion. | |
bool | isDeeplyNested (const Decl *D, unsigned MaxDepth=10) |
Checks whether D is more than MaxDepth away from translation unit scope. | |
SmallVector< const ParmVarDecl * > | resolveForwardingParameters (const FunctionDecl *D, unsigned MaxDepth=10) |
Recursively resolves the parameters of a FunctionDecl that forwards its parameters to another function via variadic template parameters. | |
bool | isExpandedFromParameterPack (const ParmVarDecl *D) |
Checks whether D is instantiated from a function parameter pack whose type is a bare type parameter pack (e.g. | |
static std::vector< llvm::StringRef > | semanticTokenTypes () |
static std::vector< llvm::StringRef > | semanticTokenModifiers () |
static std::vector< SymbolInformation > | flattenSymbolHierarchy (llvm::ArrayRef< DocumentSymbol > Symbols, const URIForFile &FileURI) |
The functions constructs a flattened view of the DocumentSymbol hierarchy. | |
static std::optional< Command > | asCommand (const CodeAction &Action) |
static Location * | getToggle (const TextDocumentPositionParams &Point, LocatedSymbol &Sym) |
llvm::json::Value | serializeTHIForExtension (TypeHierarchyItem THI) |
static void | increment (std::string &S) |
CompletionPrefix | guessCompletionPrefix (llvm::StringRef Content, unsigned Offset) |
CodeCompleteResult | codeCompleteComment (PathRef FileName, unsigned Offset, llvm::StringRef Prefix, const PreambleData *Preamble, const ParseInputs &ParseInput) |
std::optional< unsigned > | maybeFunctionArgumentCommentStart (llvm::StringRef Content) |
CodeCompleteResult | codeComplete (PathRef FileName, Position Pos, const PreambleData *Preamble, const ParseInputs &ParseInput, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind=nullptr) |
Gets code completions at a specified Pos in FileName . | |
SignatureHelp | signatureHelp (PathRef FileName, Position Pos, const PreambleData &Preamble, const ParseInputs &ParseInput, MarkupKind DocumentationFormat) |
Get signature help at a specified Pos in FileName . | |
bool | isIndexedForCodeCompletion (const NamedDecl &ND, ASTContext &ASTCtx) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const CodeCompletion &C) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const CodeCompleteResult &R) |
bool | isIncludeFile (llvm::StringRef Line) |
bool | allowImplicitCompletion (llvm::StringRef Content, unsigned Offset) |
std::string | getDocComment (const ASTContext &Ctx, const CodeCompletionResult &Result, bool CommentsFromHeaders) |
Gets a minimally formatted documentation comment of Result , with comment markers stripped. | |
std::string | getDeclComment (const ASTContext &Ctx, const NamedDecl &D) |
Similar to getDocComment, but returns the comment for a NamedDecl. | |
void | getSignature (const CodeCompletionString &CCS, std::string *Signature, std::string *Snippet, CodeCompletionResult::ResultKind ResultKind, CXCursorKind CursorKind, bool IncludeFunctionArguments=true, std::string *RequiredQualifiers=nullptr) |
Formats the signature for an item, as a display string and snippet. | |
std::string | formatDocumentation (const CodeCompletionString &CCS, llvm::StringRef DocComment) |
Assembles formatted documentation for a completion result. | |
std::string | getReturnType (const CodeCompletionString &CCS) |
Gets detail to be used as the detail field in an LSP completion item. | |
std::unique_ptr< PPCallbacks > | collectPragmaMarksCallback (const SourceManager &, std::vector< PragmaMark > &Out) |
Collect all pragma marks from the main file. | |
std::string | printArgv (llvm::ArrayRef< llvm::StringRef > Args) |
std::string | printArgv (llvm::ArrayRef< std::string > Args) |
void | allowCrashPragmasForTest () |
Respect #pragma clang __debug crash etc, which are usually disabled. | |
void | disableUnsupportedOptions (CompilerInvocation &CI) |
Clears CI from options that are not supported by clangd, like codegen or plugins. | |
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. | |
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: | |
DecisionForestScores | evaluateDecisionForest (const SymbolQualitySignals &Quality, const SymbolRelevanceSignals &Relevance, float Base) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const DiagBase &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Fix &F) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diag &D) |
Diag | toDiag (const llvm::SMDiagnostic &D, Diag::DiagSource Source) |
void | toLSPDiags (const Diag &D, const URIForFile &File, const ClangdDiagnosticOptions &Opts, llvm::function_ref< void(clangd::Diagnostic, llvm::ArrayRef< Fix >)> OutFn) |
Conversion to LSP diagnostics. | |
int | getSeverity (DiagnosticsEngine::Level L) |
Convert from clang diagnostic level to LSP severity. | |
static void | writeCodeToFixMessage (llvm::raw_ostream &OS, llvm::StringRef Code) |
Sanitizes a piece for presenting it in a synthesized fix message. | |
static void | fillNonLocationData (DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &Info, clangd::DiagBase &D) |
Fills D with all information, except the location-related bits. | |
bool | isDiagnosticSuppressed (const clang::Diagnostic &Diag, const llvm::StringSet<> &Suppressed, const LangOptions &) |
Determine whether a (non-clang-tidy) diagnostic is suppressed by config. | |
llvm::StringRef | normalizeSuppressedCode (llvm::StringRef) |
Take a user-specified diagnostic code, and convert it to a normalized form stored in the config and consumed by isDiagnosticsSuppressed. | |
std::optional< std::string > | getDiagnosticDocURI (Diag::DiagSource, unsigned ID, llvm::StringRef Name) |
Returns a URI providing more information about a particular diagnostic. | |
static void | increment (std::string &S) |
static void | updateVersion (DraftStore::Draft &D, llvm::StringRef SpecifiedVersion) |
ASTNode | dumpAST (const DynTypedNode &N, const syntax::TokenBuffer &Tokens, const ASTContext &Ctx) |
std::string | versionString () |
std::string | platformString () |
std::string | featureString () |
static llvm::SmallString< 128 > | canonicalize (llvm::StringRef Path) |
static std::pair< std::string, int > | scopeToPath (llvm::StringRef Scope) |
static FileDistance | createScopeFileDistance (llvm::ArrayRef< std::string > QueryScopes) |
llvm::Expected< Location > | indexToLSPLocation (const SymbolLocation &Loc, llvm::StringRef TUPath) |
Helper function for deriving an LSP Location from an index SymbolLocation. | |
llvm::Expected< Location > | symbolToLocation (const Symbol &Sym, llvm::StringRef TUPath) |
Helper function for deriving an LSP Location for a Symbol. | |
llvm::Expected< std::vector< SymbolInformation > > | getWorkspaceSymbols (llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath) |
Searches for the symbols matching Query . | |
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. | |
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > | allTargetDecls (const DynTypedNode &, const HeuristicResolver *) |
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along with their DeclRelationSets. | |
llvm::SmallVector< const NamedDecl *, 1 > | targetDecl (const DynTypedNode &, DeclRelationSet Mask, const HeuristicResolver *Resolver) |
targetDecl() finds the declaration referred to by an AST node. | |
llvm::SmallVector< const NamedDecl *, 1 > | explicitReferenceTargets (DynTypedNode N, DeclRelationSet Mask, const HeuristicResolver *Resolver) |
Find declarations explicitly referenced in the source code defined by N . | |
void | findExplicitReferences (const Stmt *S, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
Recursively traverse S and report all references explicitly written in the code. | |
void | findExplicitReferences (const Decl *D, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
void | findExplicitReferences (const ASTContext &AST, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, DeclRelation R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, DeclRelationSet RS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, ReferenceLoc R) |
DeclRelationSet | operator| (DeclRelation L, DeclRelation R) |
DeclRelationSet | operator& (DeclRelation L, DeclRelation R) |
DeclRelationSet | operator~ (DeclRelation R) |
std::vector< tooling::Replacement > | formatIncremental (llvm::StringRef Code, unsigned Cursor, llvm::StringRef InsertedText, format::FormatStyle Style) |
Applies limited formatting around new InsertedText . | |
unsigned | transformCursorPosition (unsigned Offset, const std::vector< tooling::Replacement > &Replacements) |
Determine the new cursor position after applying Replacements . | |
Path | removeDots (PathRef File) |
Returns a version of File that doesn't contain dots and dot dots. | |
static char | lower (char C) |
static bool | isAwful (int S) |
template<typename T> | |
static T | packedLookup (const uint8_t *Data, int I) |
CharTypeSet | calculateRoles (llvm::StringRef Text, llvm::MutableArrayRef< CharRole > Roles) |
static std::unique_ptr< tooling::CompilationDatabase > | parseJSON (PathRef Path, llvm::StringRef Data, std::string &Error) |
static std::unique_ptr< tooling::CompilationDatabase > | parseFixed (PathRef Path, llvm::StringRef Data, std::string &Error) |
SystemIncludeExtractorFn | getSystemIncludeExtractor (llvm::ArrayRef< std::string > QueryDriverGlobs) |
bool | isLiteralInclude (llvm::StringRef Include) |
Returns true if Include is literal include like "path" or <path>. | |
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. | |
llvm::SmallVector< SymbolInclude, 1 > | getRankedIncludes (const Symbol &Sym) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Inclusion &Inc) |
bool | operator== (const Inclusion &LHS, const Inclusion &RHS) |
IncludeGraphNode::SourceFlag | operator| (IncludeGraphNode::SourceFlag A, IncludeGraphNode::SourceFlag B) |
bool | operator& (IncludeGraphNode::SourceFlag A, IncludeGraphNode::SourceFlag B) |
IncludeGraphNode::SourceFlag & | operator|= (IncludeGraphNode::SourceFlag &A, IncludeGraphNode::SourceFlag B) |
std::optional< Path > | getCorrespondingHeaderOrSource (PathRef OriginalFile, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS) |
Given a header file, returns the best matching source file, and vice visa. | |
std::optional< Path > | getCorrespondingHeaderOrSource (PathRef OriginalFile, ParsedAST &AST, const SymbolIndex *Index) |
Given a header file, returns the best matching source file, and vice visa. | |
std::vector< const Decl * > | getIndexableLocalDecls (ParsedAST &AST) |
Returns all indexable decls that are present in the main file of the AST. | |
std::optional< HoverInfo > | getHover (ParsedAST &AST, Position Pos, const format::FormatStyle &Style, const SymbolIndex *Index) |
Get the hover information when hovering at Pos . | |
static std::string | formatSize (uint64_t SizeInBits) |
static std::string | formatOffset (uint64_t OffsetInBits) |
std::optional< llvm::StringRef > | getBacktickQuoteRange (llvm::StringRef Line, unsigned Offset) |
void | parseDocumentationParagraph (llvm::StringRef Text, markup::Paragraph &Out) |
void | parseDocumentation (llvm::StringRef Input, markup::Document &Output) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const HoverInfo::PrintedType &T) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const HoverInfo::Param &P) |
bool | operator== (const HoverInfo::PrintedType &LHS, const HoverInfo::PrintedType &RHS) |
bool | operator== (const HoverInfo::PassType &LHS, const HoverInfo::PassType &RHS) |
bool | operator== (const HoverInfo::Param &LHS, const HoverInfo::Param &RHS) |
std::vector< include_cleaner::SymbolReference > | collectMacroReferences (ParsedAST &AST) |
include_cleaner::Includes | convertIncludes (const ParsedAST &) |
Converts the clangd include representation to include-cleaner include representation. | |
IncludeCleanerFindings | computeIncludeCleanerFindings (ParsedAST &AST, bool AnalyzeAngledIncludes) |
bool | isPreferredProvider (const Inclusion &, const include_cleaner::Includes &, llvm::ArrayRef< include_cleaner::Header > Providers) |
Whether this #include is considered to provide a particular symbol. | |
std::vector< Diag > | issueIncludeCleanerDiagnostics (ParsedAST &AST, llvm::StringRef Code, const IncludeCleanerFindings &Findings, const ThreadsafeFS &TFS, HeaderFilter IgnoreHeaders, HeaderFilter AngledHeaders, HeaderFilter QuotedHeaders) |
std::optional< std::string > | qualifiedByUnresolved (const SourceManager &SM, SourceLocation Loc, const LangOptions &LangOpts) |
std::optional< std::string > | getSpelledSpecifier (const CXXScopeSpec &SS, const SourceManager &SM) |
std::optional< CheapUnresolvedName > | extractUnresolvedNameCheaply (const SourceManager &SM, const DeclarationNameInfo &Unresolved, CXXScopeSpec *SS, const LangOptions &LangOpts, bool UnresolvedIsSpecifier) |
std::vector< std::string > | collectAccessibleScopes (Sema &Sem, const DeclarationNameInfo &Typo, Scope *S, Sema::LookupNameKind LookupKind) |
Returns all namespace scopes that the unqualified lookup would visit. | |
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 . | |
SlabTuple | indexMainDecls (ParsedAST &AST) |
Retrieves symbols and refs of local top level decls in AST (i.e. | |
SlabTuple | indexHeaderSymbols (llvm::StringRef Version, ASTContext &AST, Preprocessor &PP, const include_cleaner::PragmaIncludes &PI, SymbolOrigin Origin) |
Index declarations from AST and macros from PP that are declared in included headers. | |
bool | fromJSON (const llvm::json::Value &Parameters, FuzzyFindRequest &Request, llvm::json::Path P) |
llvm::json::Value | toJSON (const FuzzyFindRequest &Request) |
constexpr IndexContents | operator& (IndexContents L, IndexContents R) |
constexpr IndexContents | operator| (IndexContents L, IndexContents R) |
std::unique_ptr< FrontendAction > | createStaticIndexingAction (SymbolCollector::Options Opts, std::function< void(SymbolSlab)> SymbolsCallback, std::function< void(RefSlab)> RefsCallback, std::function< void(RelationSlab)> RelationsCallback, std::function< void(IncludeGraph)> IncludeGraphCallback) |
static bool | prefer (const SymbolLocation &L, const SymbolLocation &R) |
Symbol | mergeSymbol (const Symbol &L, const Symbol &R) |
std::unique_ptr< SymbolIndex > | createProjectAwareIndex (IndexFactory, bool Sync) |
Returns an index that answers queries using external indices. | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, RefKind K) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Ref &R) |
RefKind | operator| (RefKind L, RefKind R) |
RefKind & | operator|= (RefKind &L, RefKind R) |
RefKind | operator& (RefKind A, RefKind B) |
bool | operator< (const Ref &L, const Ref &R) |
bool | operator== (const Ref &L, const Ref &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const RelationKind R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Relation &R) |
void | writeYAML (const IndexFileOut &, llvm::raw_ostream &) |
llvm::Expected< IndexFileIn > | readYAML (llvm::StringRef, SymbolOrigin Origin) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const IndexFileOut &O) |
llvm::Expected< IndexFileIn > | readIndexFile (llvm::StringRef Data, SymbolOrigin Origin) |
std::unique_ptr< SymbolIndex > | loadIndex (llvm::StringRef SymbolFilename, SymbolOrigin Origin, bool UseDex, bool SupportContainedRefs) |
std::string | toYAML (const Symbol &) |
std::string | toYAML (const std::pair< SymbolID, ArrayRef< Ref > > &) |
std::string | toYAML (const Relation &) |
std::string | toYAML (const Ref &) |
llvm::StringRef | getStdlibUmbrellaHeader (const LangOptions &LO) |
SymbolSlab | indexStandardLibrary (llvm::StringRef HeaderSources, std::unique_ptr< CompilerInvocation > CI, const StdLibLocation &Loc, const ThreadsafeFS &TFS) |
SymbolSlab | indexStandardLibrary (std::unique_ptr< CompilerInvocation > Invocation, const StdLibLocation &Loc, const ThreadsafeFS &TFS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, Symbol::SymbolFlag F) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Symbol &S) |
float | quality (const Symbol &S) |
Computes query-independent quality score for a Symbol. | |
static void | own (Symbol &S, llvm::UniqueStringSaver &Strings) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolSlab &Slab) |
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE () | |
Symbol::SymbolFlag | operator| (Symbol::SymbolFlag A, Symbol::SymbolFlag B) |
Symbol::SymbolFlag & | operator|= (Symbol::SymbolFlag &A, Symbol::SymbolFlag B) |
template<typename Callback> | |
void | visitStrings (Symbol &S, const Callback &CB) |
Invokes Callback with each StringRef& contained in the Symbol. | |
llvm::StringRef | getStdHeader (const Symbol *S, const LangOptions &LangOpts) |
static bool | refIsCall (index::SymbolKind Kind) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolID &ID) |
llvm::hash_code | hash_value (const SymbolID &ID) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolLocation &L) |
bool | operator== (const SymbolLocation::Position &L, const SymbolLocation::Position &R) |
bool | operator< (const SymbolLocation::Position &L, const SymbolLocation::Position &R) |
bool | operator== (const SymbolLocation &L, const SymbolLocation &R) |
bool | operator< (const SymbolLocation &L, const SymbolLocation &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, SymbolOrigin O) |
SymbolOrigin | operator| (SymbolOrigin A, SymbolOrigin B) |
SymbolOrigin & | operator|= (SymbolOrigin &A, SymbolOrigin B) |
SymbolOrigin | operator& (SymbolOrigin A, SymbolOrigin B) |
std::string | toYAML (const std::pair< SymbolID, llvm::ArrayRef< Ref > > &Data) |
std::vector< InlayHint > | inlayHints (ParsedAST &AST, std::optional< Range > RestrictRange, InlayHintOptions HintOptions={}) |
Compute and return inlay hints for a file. | |
std::unique_ptr< Transport > | newJSONTransport (std::FILE *In, llvm::raw_ostream &Out, llvm::raw_ostream *InMirror, bool Pretty, JSONStreamStyle Style) |
std::optional< std::string > | doPathMapping (llvm::StringRef S, PathMapping::Direction Dir, const PathMappings &Mappings) |
Returns a modified S with the first matching path in Mappings substituted, if applicable. | |
void | applyPathMappings (llvm::json::Value &Params, PathMapping::Direction Dir, const PathMappings &Mappings) |
Applies the Mappings to all the file:// URIs in Params . | |
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. | |
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. | |
std::shared_ptr< const PreambleData > | buildPreamble (PathRef FileName, CompilerInvocation CI, const ParseInputs &Inputs, bool StoreInMemory, PreambleParsedCallback PreambleCallback, PreambleBuildStats *Stats=nullptr) |
Build a preamble for the new inputs unless an old one can be reused. | |
bool | isPreambleCompatible (const PreambleData &Preamble, const ParseInputs &Inputs, PathRef FileName, const CompilerInvocation &CI) |
Returns true if Preamble is reusable for Inputs . | |
void | escapeBackslashAndQuotes (llvm::StringRef Text, llvm::raw_ostream &OS) |
static std::vector< Diag > | patchDiags (llvm::ArrayRef< Diag > BaselineDiags, const ScannedPreamble &BaselineScan, const ScannedPreamble &ModifiedScan) |
static std::string | getPatchName (llvm::StringRef FileName) |
bool | fromJSON (const llvm::json::Value &E, URIForFile &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const URIForFile &U) |
Serialize/deserialize URIForFile to/from a string URI. | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const URIForFile &U) |
llvm::json::Value | toJSON (const TextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentIdentifier &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const VersionedTextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, VersionedTextDocumentIdentifier &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Position &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Position &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Position &P) |
bool | fromJSON (const llvm::json::Value &Params, Range &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Range &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Range &R) |
llvm::json::Value | toJSON (const Location &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Location &L) |
llvm::json::Value | toJSON (const ReferenceLocation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ReferenceLocation &L) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentItem &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextEdit &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const TextEdit &P) |
bool | fromJSON (const llvm::json::Value &Params, ChangeAnnotation &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const ChangeAnnotation &CA) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentEdit &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const TextDocumentEdit &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const TextEdit &TE) |
bool | fromJSON (const llvm::json::Value &E, TraceLevel &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, SymbolKind &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, SymbolKindBitset &Out, llvm::json::Path P) |
SymbolKind | adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds) |
SymbolKind | indexSymbolKindToSymbolKind (index::SymbolKind Kind) |
bool | fromJSON (const llvm::json::Value &Params, ClientCapabilities &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, InitializeParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const WorkDoneProgressCreateParams &P) |
llvm::json::Value | toJSON (const WorkDoneProgressBegin &P) |
llvm::json::Value | toJSON (const WorkDoneProgressReport &P) |
llvm::json::Value | toJSON (const WorkDoneProgressEnd &P) |
llvm::json::Value | toJSON (const MessageType &R) |
llvm::json::Value | toJSON (const ShowMessageParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidOpenTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidCloseTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidSaveTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeTextDocumentParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, FileChangeType &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, FileEvent &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeWatchedFilesParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentContentChangeEvent &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentRangeFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentRangesFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentOnTypeFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentFormattingParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentSymbolParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const DiagnosticRelatedInformation &DRI) |
llvm::json::Value | toJSON (DiagnosticTag Tag) |
llvm::json::Value | toJSON (const CodeDescription &D) |
llvm::json::Value | toJSON (const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, Diagnostic &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const PublishDiagnosticsParams &PDP) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionContext &R, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceEdit &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ExecuteCommandParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const SymbolInformation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolInformation &SI) |
bool | operator== (const SymbolDetails &LHS, const SymbolDetails &RHS) |
llvm::json::Value | toJSON (const SymbolDetails &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolDetails &S) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceSymbolParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const Command &C) |
llvm::json::Value | toJSON (const CodeAction &CA) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentSymbol &S) |
llvm::json::Value | toJSON (const DocumentSymbol &S) |
llvm::json::Value | toJSON (const WorkspaceEdit &WE) |
bool | fromJSON (const llvm::json::Value &Params, TweakArgs &A, llvm::json::Path P) |
llvm::json::Value | toJSON (const TweakArgs &A) |
llvm::json::Value | toJSON (const ApplyWorkspaceEditParams &Params) |
bool | fromJSON (const llvm::json::Value &Response, ApplyWorkspaceEditResponse &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentPositionParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CompletionContext &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CompletionParams &R, llvm::json::Path P) |
static llvm::StringRef | toTextKind (MarkupKind Kind) |
bool | fromJSON (const llvm::json::Value &V, MarkupKind &K, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, MarkupKind K) |
llvm::json::Value | toJSON (const MarkupContent &MC) |
llvm::json::Value | toJSON (const Hover &H) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKind &Out, llvm::json::Path P) |
CompletionItemKind | adjustKindToCapability (CompletionItemKind Kind, CompletionItemKindBitset &SupportedCompletionItemKinds) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKindBitset &Out, llvm::json::Path P) |
llvm::json::Value | toJSON (const CompletionItemLabelDetails &CD) |
void | removeCompletionLabelDetails (CompletionItem &) |
Remove the labelDetails field (for clients that don't support it). | |
llvm::json::Value | toJSON (const CompletionItem &CI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const CompletionItem &I) |
bool | operator< (const CompletionItem &L, const CompletionItem &R) |
llvm::json::Value | toJSON (const CompletionList &L) |
llvm::json::Value | toJSON (const ParameterInformation &PI) |
llvm::json::Value | toJSON (const SignatureInformation &SI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SignatureInformation &I) |
llvm::json::Value | toJSON (const SignatureHelp &SH) |
bool | fromJSON (const llvm::json::Value &Params, RenameParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const RenameParams &R) |
llvm::json::Value | toJSON (const PrepareRenameResult &PRR) |
llvm::json::Value | toJSON (const DocumentHighlight &DH) |
llvm::json::Value | toJSON (const FileStatus &FStatus) |
static llvm::json::Value | encodeTokens (llvm::ArrayRef< SemanticToken > Toks) |
bool | operator== (const SemanticToken &L, const SemanticToken &R) |
llvm::json::Value | toJSON (const SemanticTokens &Tokens) |
llvm::json::Value | toJSON (const SemanticTokensEdit &Edit) |
llvm::json::Value | toJSON (const SemanticTokensOrDelta &TE) |
bool | fromJSON (const llvm::json::Value &Params, SemanticTokensParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, SemanticTokensDeltaParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const InactiveRegionsParams &InactiveRegions) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentHighlight &V) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeConfigurationParams &CCP, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ClangdCompileCommand &CDbUpdate, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ConfigurationSettings &S, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, InitializationOptions &Opts, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &E, TypeHierarchyDirection &Out, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyPrepareParams &R, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const TypeHierarchyItem &I) |
llvm::json::Value | toJSON (const TypeHierarchyItem::ResolveParams &RP) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyItem::ResolveParams &RP, llvm::json::Path P) |
llvm::json::Value | toJSON (const TypeHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, TypeHierarchyItem &I, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ResolveTypeHierarchyItemParams &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceContext &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (SymbolTag Tag) |
llvm::json::Value | toJSON (const CallHierarchyItem &I) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyItem &I, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyIncomingCallsParams &C, llvm::json::Path P) |
llvm::json::Value | toJSON (const CallHierarchyIncomingCall &C) |
bool | fromJSON (const llvm::json::Value &Params, CallHierarchyOutgoingCallsParams &C, llvm::json::Path P) |
llvm::json::Value | toJSON (const CallHierarchyOutgoingCall &C) |
bool | fromJSON (const llvm::json::Value &Params, InlayHintsParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const InlayHintKind &Kind) |
llvm::json::Value | toJSON (const InlayHint &H) |
bool | operator== (const InlayHint &A, const InlayHint &B) |
bool | operator< (const InlayHint &A, const InlayHint &B) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, InlayHintKind Kind) |
llvm::json::Value | toJSON (const InlayHintLabelPart &L) |
bool | operator== (const InlayHintLabelPart &LHS, const InlayHintLabelPart &RHS) |
bool | operator< (const InlayHintLabelPart &LHS, const InlayHintLabelPart &RHS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const InlayHintLabelPart &L) |
static const char * | toString (OffsetEncoding OE) |
llvm::json::Value | toJSON (const OffsetEncoding &OE) |
bool | fromJSON (const llvm::json::Value &V, OffsetEncoding &OE, llvm::json::Path P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, OffsetEncoding Enc) |
bool | fromJSON (const llvm::json::Value &Params, SelectionRangeParams &S, llvm::json::Path P) |
llvm::json::Value | toJSON (const SelectionRange &Out) |
bool | fromJSON (const llvm::json::Value &Params, DocumentLinkParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const DocumentLink &DocumentLink) |
bool | fromJSON (const llvm::json::Value &Params, FoldingRangeParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const FoldingRange &Range) |
llvm::json::Value | toJSON (const MemoryTree &MT) |
Keys starting with an underscore(_) represent leaves, e.g. | |
bool | fromJSON (const llvm::json::Value &Params, ASTParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const ASTNode &N) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ASTNode &Root) |
bool | fromJSON (const llvm::json::Value &E, SymbolID &S, llvm::json::Path P) |
llvm::json::Value | toJSON (const SymbolID &S) |
bool | operator== (const TextEdit &L, const TextEdit &R) |
llvm::json::Value | toJSON (const NoParams &) |
bool | fromJSON (const llvm::json::Value &, NoParams &, llvm::json::Path) |
template<typename T> | |
llvm::json::Value | toJSON (const ProgressParams< T > &P) |
bool | fromJSON (const TypeHierarchyItem::ResolveParams &) |
static bool | hasDeclInMainFile (const Decl &D) |
static bool | hasUsingDeclInMainFile (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const NamedDecl &ND) |
static SymbolQualitySignals::SymbolCategory | categorize (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const index::SymbolInfo &D) |
static bool | isInstanceMember (const NamedDecl *ND) |
static bool | isInstanceMember (const index::SymbolInfo &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolQualitySignals &S) |
static SymbolRelevanceSignals::AccessibleScope | computeScope (const NamedDecl *D) |
static float | fileProximityScore (unsigned FileDistance) |
static float | scopeProximityScore (unsigned ScopeDistance) |
static std::optional< llvm::StringRef > | wordMatching (llvm::StringRef Name, const llvm::StringSet<> *ContextWords) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolRelevanceSignals &S) |
float | evaluateSymbolAndRelevance (float SymbolQuality, float SymbolRelevance) |
Combine symbol quality and relevance into a single score. | |
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. | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SignatureQualitySignals &S) |
SourceLocation | insertionPoint (const DeclContext &DC, llvm::ArrayRef< Anchor > Anchors) |
llvm::Expected< tooling::Replacement > | insertDecl (llvm::StringRef Code, const DeclContext &DC, llvm::ArrayRef< Anchor > Anchors) |
SourceLocation | insertionPoint (const CXXRecordDecl &InClass, std::vector< Anchor > Anchors, AccessSpecifier Protection) |
llvm::Expected< tooling::Replacement > | insertDecl (llvm::StringRef Code, const CXXRecordDecl &InClass, std::vector< Anchor > Anchors, AccessSpecifier Protection) |
bool | operator== (const SymbolRange &LHS, const SymbolRange &RHS) |
bool | operator!= (const SymbolRange &LHS, const SymbolRange &RHS) |
bool | operator< (const SymbolRange &LHS, const SymbolRange &RHS) |
llvm::Expected< RenameResult > | rename (const RenameInputs &RInputs) |
Renames all occurrences of the symbol. | |
llvm::Expected< Edit > | buildRenameEdit (llvm::StringRef AbsFilePath, llvm::StringRef InitialCode, std::vector< SymbolRange > Occurrences, llvm::ArrayRef< llvm::StringRef > NewNames) |
Generates rename edits that replaces all given occurrences with the NewName. | |
std::optional< std::vector< SymbolRange > > | adjustRenameRanges (llvm::StringRef DraftCode, const RenameSymbolName &Name, std::vector< Range > Indexed, const LangOptions &LangOpts) |
Adjusts indexed occurrences to match the current state of the file. | |
std::optional< std::vector< SymbolRange > > | getMappedRanges (ArrayRef< Range > Indexed, ArrayRef< SymbolRange > Lexed) |
Calculates the lexed occurrences that the given indexed occurrences map to. | |
size_t | renameRangeAdjustmentCost (ArrayRef< Range > Indexed, ArrayRef< SymbolRange > Lexed, ArrayRef< size_t > MappedIndex) |
Evaluates how good the mapped result is. | |
std::vector< std::unique_ptr< Tweak > > | prepareTweaks (const Tweak::Selection &S, llvm::function_ref< bool(const Tweak &)> Filter, const FeatureModuleSet *Modules) |
Calls prepare() on all tweaks that satisfy the filter, returning those that can run on the selection. | |
llvm::Expected< std::unique_ptr< Tweak > > | prepareTweak (StringRef ID, const Tweak::Selection &S, const FeatureModuleSet *Modules) |
std::unique_ptr< ProjectModules > | scanningProjectModules (std::shared_ptr< const clang::tooling::CompilationDatabase > CDB, const ThreadsafeFS &TFS) |
Providing modules information for the project by scanning every file. | |
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, bool IncludeInactiveRegionTokens) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, HighlightingKind K) |
std::optional< HighlightingKind > | highlightingKindFromString (llvm::StringRef Name) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, HighlightingModifier K) |
std::optional< HighlightingModifier > | highlightingModifierFromString (llvm::StringRef Name) |
bool | operator== (const HighlightingToken &L, const HighlightingToken &R) |
bool | operator< (const HighlightingToken &L, const HighlightingToken &R) |
std::vector< SemanticToken > | toSemanticTokens (llvm::ArrayRef< HighlightingToken > Tokens, llvm::StringRef Code) |
llvm::StringRef | toSemanticTokenType (HighlightingKind Kind) |
llvm::StringRef | toSemanticTokenModifier (HighlightingModifier Modifier) |
std::vector< SemanticTokensEdit > | diffTokens (llvm::ArrayRef< SemanticToken > Old, llvm::ArrayRef< SemanticToken > New) |
std::vector< Range > | getInactiveRegions (ParsedAST &AST) |
llvm::Expected< SelectionRange > | getSemanticRanges (ParsedAST &AST, Position Pos) |
Returns the list of all interesting ranges around the Position Pos . | |
llvm::Expected< std::vector< FoldingRange > > | getFoldingRanges (ParsedAST &AST) |
Returns a list of ranges whose contents might be collapsible in an editor. | |
llvm::Expected< std::vector< FoldingRange > > | getFoldingRanges (const std::string &Code, bool LineFoldingOnly) |
Returns a list of ranges whose contents might be collapsible in an editor. | |
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. | |
Position | offsetToPosition (llvm::StringRef Code, size_t Offset) |
Turn an offset in Code into a [line, column] pair. | |
Position | sourceLocToPosition (const SourceManager &SM, SourceLocation Loc) |
Turn a SourceLocation into a [line, column] pair. | |
bool | isSpelledInSource (SourceLocation Loc, const SourceManager &SM) |
Returns true if the token at Loc is spelled in the source code. | |
bool | isValidFileRange (const SourceManager &Mgr, SourceRange R) |
Returns true iff all of the following conditions hold: | |
SourceLocation | includeHashLoc (FileID IncludedFile, const SourceManager &SM) |
Returns the #include location through which IncludedFIle was loaded. | |
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. | |
std::optional< SourceRange > | toHalfOpenFileRange (const SourceManager &Mgr, const LangOptions &LangOpts, SourceRange R) |
Turns a token range into a half-open range and checks its correctness. | |
llvm::StringRef | toSourceCode (const SourceManager &SM, SourceRange R) |
Returns the source code covered by the source range. | |
llvm::Expected< SourceLocation > | sourceLocationInMainFile (const SourceManager &SM, Position P) |
Return the file location, corresponding to P . | |
Range | halfOpenToRange (const SourceManager &SM, CharSourceRange R) |
void | unionRanges (Range &A, Range B) |
std::pair< size_t, size_t > | offsetToClangLineColumn (llvm::StringRef Code, size_t Offset) |
std::pair< StringRef, StringRef > | splitQualifiedName (StringRef QName) |
TextEdit | replacementToEdit (llvm::StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (llvm::StringRef Code, const tooling::Replacements &Repls) |
std::optional< std::string > | getCanonicalPath (const FileEntryRef F, FileManager &FileMgr) |
Get the canonical path of F . | |
TextEdit | toTextEdit (const FixItHint &FixIt, const SourceManager &M, const LangOptions &L) |
FileDigest | digest (llvm::StringRef Content) |
std::optional< FileDigest > | digestFile (const SourceManager &SM, FileID FID) |
format::FormatStyle | getFormatStyleForFile (llvm::StringRef File, llvm::StringRef Content, const ThreadsafeFS &TFS, bool FormatFile) |
Choose the clang-format style we should apply to a certain file. | |
llvm::Expected< tooling::Replacements > | cleanupAndFormat (StringRef Code, const tooling::Replacements &Replaces, const format::FormatStyle &Style) |
Cleanup and format the given replacements. | |
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. | |
std::vector< Range > | collectIdentifierRanges (llvm::StringRef Identifier, llvm::StringRef Content, const LangOptions &LangOpts) |
Collects all ranges of the given identifier in the source code. | |
bool | isKeyword (llvm::StringRef TokenName, const LangOptions &LangOpts) |
Return true if the TokenName is in the list of reversed keywords of the language. | |
std::vector< std::string > | visibleNamespaces (llvm::StringRef Code, const LangOptions &LangOpts) |
Heuristically determine namespaces visible at a point, without parsing Code. | |
llvm::StringSet | collectWords (llvm::StringRef Content) |
Collects words from the source code. | |
static bool | isLikelyIdentifier (llvm::StringRef Word, llvm::StringRef Before, llvm::StringRef After) |
std::optional< DefinedMacro > | locateMacroAt (const syntax::Token &SpelledTok, Preprocessor &PP) |
Gets the macro referenced by SpelledTok . | |
llvm::Error | reformatEdit (Edit &E, const format::FormatStyle &Style) |
Formats the edits and code around it according to Style. | |
static void | inferFinalNewline (llvm::Expected< size_t > &Err, std::string &Contents, const Position &Pos) |
llvm::Error | applyChange (std::string &Contents, const TextDocumentContentChangeEvent &Change) |
Apply an incremental update to a text document. | |
EligibleRegion | getEligiblePoints (llvm::StringRef Code, llvm::StringRef FullyQualifiedName, const LangOptions &LangOpts) |
Returns most eligible region to insert a definition for FullyQualifiedName in the Code . | |
bool | isHeaderFile (llvm::StringRef FileName, std::optional< LangOptions > LangOpts=std::nullopt) |
Infers whether this is a header from the FileName and LangOpts (if presents). | |
bool | isProtoFile (SourceLocation Loc, const SourceManager &SourceMgr) |
Returns true if the given location is in a generated protobuf file. | |
SourceLocation | translatePreamblePatchLocation (SourceLocation Loc, const SourceManager &SM) |
Translates locations inside preamble patch to their main-file equivalent using presumed locations. | |
clangd::Range | rangeTillEOL (llvm::StringRef Code, unsigned HashOffset) |
Returns the range starting at offset and spanning the whole line. | |
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"}. | |
TextEdit | replacementToEdit (StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (StringRef Code, const tooling::Replacements &Repls) |
bool | isReservedName (llvm::StringRef Name) |
Returns true if Name is reserved, like _Foo or __Vector_base. | |
void | pairBrackets (TokenStream &) |
Identifies bracket token in the stream which should be paired. | |
std::pair< Context, Canceler > | cancelableTask (int Reason=1) |
Defines a new task whose cancellation may be requested. | |
int | isCancelled (const Context &Ctx=Context::current()) |
If the current context is within a cancelled task, returns the reason. | |
static Context & | currentContext () |
void | chooseConditionalBranches (DirectiveTree &, const TokenStream &Code) |
Describes the structure of a source file, as seen by the preprocessor. | |
std::vector< Token::Range > | pairDirectiveRanges (const DirectiveTree &Tree, const TokenStream &Code) |
Pairs preprocessor conditional directives and computes their token ranges. | |
TokenStream | lex (const std::string &, const clang::LangOptions &) |
Extracts a raw token stream from the source code. | |
TokenStream | cook (const TokenStream &Code, const LangOptions &LangOpts) |
template<typename... Ts> | |
void | elog (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
void | log (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
void | vlog (const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
llvm::Error | error (std::error_code EC, const char *Fmt, Ts &&... Vals) |
template<typename... Ts> | |
llvm::Error | error (const char *Fmt, Ts &&... Vals) |
llvm::Error | error (std::error_code EC, std::string Msg) |
llvm::Error | error (std::string Msg) |
void | record (const MemoryTree &MT, std::string RootName, const trace::Metric &Out) |
Records total memory usage of each node under Out . | |
std::string | maybeCaseFoldPath (PathRef Path) |
bool | pathEqual (PathRef A, PathRef B) |
PathRef | absoluteParent (PathRef Path) |
Variant of parent_path that operates only on absolute paths. | |
bool | pathStartsWith (PathRef Ancestor, PathRef Path, llvm::sys::path::Style Style=llvm::sys::path::Style::native) |
Checks if Ancestor is a proper ancestor of Path . | |
void | abortAfterTimeout (std::chrono::seconds Timeout) |
Causes this process to crash if still running after Timeout. | |
void | requestShutdown () |
Sets a flag to indicate that clangd was sent a shutdown signal, and the transport loop should exit at the next opportunity. | |
bool | shutdownRequested () |
Checks whether requestShutdown() was called. | |
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. | |
Deadline | timeoutSeconds (std::optional< double > Seconds) |
Makes a deadline from a timeout in seconds. std::nullopt means wait forever. | |
void | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D) |
Wait once on CV for the specified duration. | |
template<typename Func> | |
bool | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D, Func F) |
Waits on a condition variable until F() is true or D expires. | |
template<typename T> | |
std::future< T > | runAsync (llvm::unique_function< T()> Action) |
Runs Action asynchronously with a new std::thread. | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Token &T) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const TokenStream &TS) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Token::Range &R) |
clang::LangOptions | genericLangOpts (clang::Language=clang::Language::CXX, clang::LangStandard::Kind=clang::LangStandard::lang_unspecified) |
A generic lang options suitable for lexing/parsing a langage. | |
TokenStream | stripComments (const TokenStream &) |
Drops comment tokens. | |
TokenStream | cook (const TokenStream &, const clang::LangOptions &) |
Decoding raw tokens written in the source code, returning a derived stream. | |
static void | mergeCheckList (std::optional< std::string > &Checks, llvm::StringRef List) |
TidyProvider | provideEnvironment () |
Provider that just sets the defaults. | |
TidyProvider | provideDefaultChecks () |
Provider that will enable a nice set of default checks if none are specified. | |
TidyProvider | addTidyChecks (llvm::StringRef Checks, llvm::StringRef WarningsAsErrors={}) |
Provider the enables a specific set of checks and warnings as errors. | |
TidyProvider | disableUnusableChecks (llvm::ArrayRef< std::string > ExtraBadChecks={}) |
Provider that will disable checks known to not work with clangd. | |
TidyProvider | provideClangdConfig () |
TidyProvider | provideClangTidyFiles (ThreadsafeFS &) |
Provider that searches for .clang-tidy configuration files in the directory tree. | |
TidyProvider | combine (std::vector< TidyProvider > Providers) |
tidy::ClangTidyOptions | getTidyOptionsForFile (TidyProviderRef Provider, llvm::StringRef Filename) |
bool | isRegisteredTidyCheck (llvm::StringRef Check) |
Returns if Check is a registered clang-tidy check. | |
std::optional< bool > | isFastTidyCheck (llvm::StringRef Check) |
Returns if Check is known-fast, known-slow, or its speed is unknown. | |
bool | check (llvm::StringRef File, const ThreadsafeFS &TFS, const ClangdLSPServer::Options &Opts) |
int | clangdMain (int argc, char *argv[]) |
unsigned | getDefaultAsyncThreadsCount () |
Returns a number of a default async threads to use for TUScheduler. | |
static clangd::Range | toLSPRange (llvm::StringRef Code, llvm::Annotations::Range R) |
MATCHER_P (named, N, "") | |
MATCHER_P (qName, N, "") | |
MATCHER (declared, "") | |
MATCHER (defined, "") | |
MATCHER_P (fileURI, F, "") | |
::testing::Matcher< const RefSlab & > | refsAre (std::vector<::testing::Matcher< Ref > > Matchers) |
MATCHER (emptyIncludeNode, "") | |
MATCHER (hadErrors, "") | |
MATCHER_P (numReferences, N, "") | |
TEST_F (BackgroundIndexTest, NoCrashOnErrorFile) | |
TEST_F (BackgroundIndexTest, Config) | |
TEST_F (BackgroundIndexTest, IndexTwoFiles) | |
TEST_F (BackgroundIndexTest, MainFileRefs) | |
TEST_F (BackgroundIndexTest, ShardStorageTest) | |
TEST_F (BackgroundIndexTest, DirectIncludesTest) | |
TEST_F (BackgroundIndexTest, ShardStorageLoad) | |
TEST_F (BackgroundIndexTest, ShardStorageEmptyFile) | |
TEST_F (BackgroundIndexTest, NoDotsInAbsPath) | |
TEST_F (BackgroundIndexTest, UncompilableFiles) | |
TEST_F (BackgroundIndexTest, CmdLineHash) | |
TEST_F (BackgroundIndexTest, Reindex) | |
TEST_F (BackgroundIndexRebuilderTest, IndexingTUs) | |
TEST_F (BackgroundIndexRebuilderTest, LoadingShards) | |
TEST (BackgroundQueueTest, Priority) | |
TEST (BackgroundQueueTest, Boost) | |
TEST (BackgroundQueueTest, Duplicates) | |
TEST (BackgroundQueueTest, Progress) | |
TEST (BackgroundIndex, Profile) | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const CallHierarchyItem &Item) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const CallHierarchyIncomingCall &Call) |
TEST (DecisionForestRuntime, Evaluate) | |
MATCHER_P2 (hasFlag, Flag, Path, "") | |
auto | hasFlag (llvm::StringRef Flag) |
TEST_F (DirectoryBasedGlobalCompilationDatabaseCacheTest, Cacheable) | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &Stream, const InlayHint &Hint) |
static void | logBody (llvm::StringRef Method, llvm::json::Value V, bool Send) |
template<typename... Args> | |
PolySubsequenceMatcher< Args... > | HasSubsequence (Args &&... M) |
std::unique_ptr< SymbolIndex > | createIndex () |
TEST (ProjectAware, Test) | |
TEST (ProjectAware, CreatedOnce) | |
TEST (ContextTests, Simple) | |
TEST (ContextTests, MoveOps) | |
TEST (ContextTests, Builders) | |
TEST_F (ThreadingTest, TaskRunner) | |
TEST_F (ThreadingTest, Memoize) | |
TEST_F (ThreadingTest, MemoizeDeterministic) | |
TEST (PeriodicThrottlerTest, Minimal) | |
TEST (SymbolDocumentation, UnhandledDocs) | |
void | runAddDocument (ClangdServer &Server, PathRef File, llvm::StringRef Contents, llvm::StringRef Version, WantDiagnostics WantDiags, bool ForceRebuild) |
llvm::Expected< CodeCompleteResult > | runCodeComplete (ClangdServer &Server, PathRef File, Position Pos, clangd::CodeCompleteOptions Opts) |
llvm::Expected< SignatureHelp > | runSignatureHelp (ClangdServer &Server, PathRef File, Position Pos, MarkupKind DocumentationFormat) |
llvm::Expected< std::vector< LocatedSymbol > > | runLocateSymbolAt (ClangdServer &Server, PathRef File, Position Pos) |
llvm::Expected< std::vector< DocumentHighlight > > | runFindDocumentHighlights (ClangdServer &Server, PathRef File, Position Pos) |
llvm::Expected< RenameResult > | runRename (ClangdServer &Server, PathRef File, Position Pos, llvm::StringRef NewName, const RenameOptions &RenameOpts) |
llvm::Expected< RenameResult > | runPrepareRename (ClangdServer &Server, PathRef File, Position Pos, std::optional< std::string > NewName, const RenameOptions &RenameOpts) |
llvm::Expected< tooling::Replacements > | runFormatFile (ClangdServer &Server, PathRef File, const std::vector< Range > &Rngs) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, llvm::StringRef Query) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, const FuzzyFindRequest &Req) |
RefSlab | getRefs (const SymbolIndex &Index, SymbolID ID) |
llvm::Expected< std::vector< SelectionRange > > | runSemanticRanges (ClangdServer &Server, PathRef File, const std::vector< Position > &Pos) |
llvm::Expected< std::optional< clangd::Path > > | runSwitchHeaderSource (ClangdServer &Server, PathRef File) |
llvm::Error | runCustomAction (ClangdServer &Server, PathRef File, llvm::function_ref< void(InputsAndAST)> Action) |
void | runAddDocument (ClangdServer &Server, PathRef File, StringRef Contents, StringRef Version="null", WantDiagnostics WantDiags=WantDiagnostics::Auto, bool ForceRebuild=false) |
llvm::Expected< RenameResult > | runRename (ClangdServer &Server, PathRef File, Position Pos, StringRef NewName, const clangd::RenameOptions &RenameOpts) |
SymbolSlab | runFuzzyFind (const SymbolIndex &Index, StringRef Query) |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | buildTestFS (llvm::StringMap< std::string > const &Files, llvm::StringMap< time_t > const &Timestamps) |
const char * | testRoot () |
std::string | testPath (PathRef File, llvm::sys::path::Style Style) |
static URISchemeRegistry::Add< TestScheme > | X (TestScheme::Scheme, "Test schema") |
Symbol | symbol (llvm::StringRef QName) |
static std::string | replace (llvm::StringRef Haystack, llvm::StringRef Needle, llvm::StringRef Repl) |
Symbol | sym (llvm::StringRef QName, index::SymbolKind Kind, llvm::StringRef USRFormat, llvm::StringRef Signature) |
Symbol | func (llvm::StringRef Name) |
Symbol | cls (llvm::StringRef Name) |
Symbol | enm (llvm::StringRef Name) |
Symbol | enmConstant (llvm::StringRef Name) |
Symbol | var (llvm::StringRef Name) |
Symbol | ns (llvm::StringRef Name) |
Symbol | conceptSym (llvm::StringRef Name) |
Symbol | macro (llvm::StringRef Name, llvm::StringRef ArgList) |
Symbol | objcSym (llvm::StringRef Name, index::SymbolKind Kind, llvm::StringRef USRPrefix) |
Symbol | objcClass (llvm::StringRef Name) |
Symbol | objcCategory (llvm::StringRef Name, llvm::StringRef CategoryName) |
Symbol | objcProtocol (llvm::StringRef Name) |
SymbolSlab | generateSymbols (std::vector< std::string > QualifiedNames) |
SymbolSlab | generateNumSymbols (int Begin, int End) |
std::string | getQualifiedName (const Symbol &Sym) |
std::vector< std::string > | match (const SymbolIndex &I, const FuzzyFindRequest &Req, bool *Incomplete) |
std::vector< std::string > | lookup (const SymbolIndex &I, llvm::ArrayRef< SymbolID > IDs) |
void | initializeModuleCache (CompilerInvocation &CI) |
void | deleteModuleCache (const std::string ModuleCachePath) |
const Symbol & | findSymbol (const SymbolSlab &Slab, llvm::StringRef QName) |
const NamedDecl & | findDecl (ParsedAST &AST, llvm::StringRef QName) |
const NamedDecl & | findDecl (ParsedAST &AST, std::function< bool(const NamedDecl &)> Filter) |
const NamedDecl & | findUnqualifiedDecl (ParsedAST &AST, llvm::StringRef Name) |
MATCHER_P2 (FileWithContents, FileName, Contents, "") | |
xpc_object_t | jsonToXpc (const json::Value &JSON) |
json::Value | xpcToJson (const xpc_object_t &XPCObject) |
xpc_object_t | jsonToXpc (const llvm::json::Value &JSON) |
std::unique_ptr< Transport > | newXPCTransport () |
std::vector< LocatedSymbol > | locateSymbolTextually (const SpelledWord &Word, ParsedAST &AST, const SymbolIndex *Index, llvm::StringRef MainFilePath, ASTNodeKind NodeKind) |
const syntax::Token * | findNearbyIdentifier (const SpelledWord &Word, const syntax::TokenBuffer &TB) |
std::vector< LocatedSymbol > | locateSymbolAt (ParsedAST &AST, Position Pos, const SymbolIndex *Index=nullptr) |
Get definition of symbol at a specified Pos . | |
std::vector< DocumentLink > | getDocumentLinks (ParsedAST &AST) |
Get all document links. | |
std::vector< DocumentHighlight > | findDocumentHighlights (ParsedAST &AST, Position Pos) |
Returns highlights for all usages of a symbol at Pos . | |
std::vector< LocatedSymbol > | findImplementations (ParsedAST &AST, Position Pos, const SymbolIndex *Index) |
Returns implementations at a specified Pos: | |
ReferencesResult | findReferences (ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index=nullptr, bool AddContext=false) |
Returns references of the symbol at a specified Pos . | |
std::vector< SymbolDetails > | getSymbolInfo (ParsedAST &AST, Position Pos) |
Get info about symbols at Pos . | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const LocatedSymbol &S) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const ReferencesResult::Reference &R) |
template<typename HierarchyItem> | |
static std::optional< HierarchyItem > | declToHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
static std::optional< TypeHierarchyItem > | declToTypeHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
static std::optional< CallHierarchyItem > | declToCallHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath) |
template<typename HierarchyItem> | |
static std::optional< HierarchyItem > | symbolToHierarchyItem (const Symbol &S, PathRef TUPath) |
static std::optional< TypeHierarchyItem > | symbolToTypeHierarchyItem (const Symbol &S, PathRef TUPath) |
static std::optional< CallHierarchyItem > | symbolToCallHierarchyItem (const Symbol &S, PathRef TUPath) |
static void | fillSubTypes (const SymbolID &ID, std::vector< TypeHierarchyItem > &SubTypes, const SymbolIndex *Index, int Levels, PathRef TUPath) |
static void | fillSuperTypes (const CXXRecordDecl &CXXRD, llvm::StringRef TUPath, TypeHierarchyItem &Item, RecursionProtectionSet &RPSet) |
std::vector< const CXXRecordDecl * > | findRecordTypeAt (ParsedAST &AST, Position Pos) |
Find the record types referenced at Pos . | |
static QualType | typeForNode (const ASTContext &Ctx, const SelectionTree::Node *N) |
static void | unwrapFindType (QualType T, const HeuristicResolver *H, llvm::SmallVector< QualType > &Out) |
static llvm::SmallVector< QualType > | unwrapFindType (QualType T, const HeuristicResolver *H) |
std::vector< LocatedSymbol > | findType (ParsedAST &AST, Position Pos, const SymbolIndex *Index) |
Returns symbols for types referenced at Pos . | |
std::vector< const CXXRecordDecl * > | typeParents (const CXXRecordDecl *CXXRD) |
Given a record type declaration, find its base (parent) types. | |
std::vector< TypeHierarchyItem > | getTypeHierarchy (ParsedAST &AST, Position Pos, int Resolve, TypeHierarchyDirection Direction, const SymbolIndex *Index=nullptr, PathRef TUPath=PathRef{}) |
Get type hierarchy information at Pos . | |
std::optional< std::vector< TypeHierarchyItem > > | superTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index) |
Returns direct parents of a TypeHierarchyItem using SymbolIDs stored inside the item. | |
std::vector< TypeHierarchyItem > | subTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index) |
Returns direct children of a TypeHierarchyItem. | |
void | resolveTypeHierarchy (TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index) |
std::vector< CallHierarchyItem > | prepareCallHierarchy (ParsedAST &AST, Position Pos, PathRef TUPath) |
Get call hierarchy information at Pos . | |
std::vector< CallHierarchyIncomingCall > | incomingCalls (const CallHierarchyItem &Item, const SymbolIndex *Index) |
std::vector< CallHierarchyOutgoingCall > | outgoingCalls (const CallHierarchyItem &Item, const SymbolIndex *Index) |
llvm::DenseSet< const Decl * > | getNonLocalDeclRefs (ParsedAST &AST, const FunctionDecl *FD) |
Returns all decls that are referenced in the FD except local symbols. |
Variables | |
static bool | AllowCrashPragmasForTest = false |
static constexpr int | AwfulScore = -(1 << 13) |
static constexpr int | PerfectBonus = 4 |
static constexpr uint8_t | CharTypes [] |
static constexpr uint8_t | CharRoles [] |
static std::atomic< bool > | PreventStarvation = {false} |
constexpr int | MaxSuffixComponents = 3 |
The maximum number of path components in a key from StdSuffixHeaderMapping. | |
constexpr unsigned | SemanticTokenEncodingSize = 5 |
constexpr auto | CompletionItemKindMin |
constexpr auto | CompletionItemKindMax |
constexpr auto | SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
constexpr auto | SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
Key< OffsetEncoding > | kCurrentOffsetEncoding |
static Key< CancelState > | StateKey |
static constexpr uint64_t | CacheDiskMismatch |
static constexpr uint64_t | FileNotFound = CacheDiskMismatch - 1 |
MaxBackticks = std::max(Backticks, MaxBackticks) | |
static std::atomic< bool > | ShutdownRequested = {false} |
static thread_local ThreadCrashReporter * | CurrentReporter = nullptr |
static clang::clangd::Key< std::string > | FileBeingProcessed |
static int LLVM_ATTRIBUTE_UNUSED | UnittestSchemeAnchorDest |
volatile int | UnittestSchemeAnchorSource = 0 |
static int LLVM_ATTRIBUTE_UNUSED | UnittestSchemeAnchorDest |
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
using clang::clangd::Callback = 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 = 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::ChangeAnnotationIdentifier = std::string |
Definition at line 241 of file Protocol.h.
using clang::clangd::CharTypeSet = unsigned char |
Definition at line 49 of file FuzzyMatch.h.
using clang::clangd::CompletionItemKindBitset = std::bitset<CompletionItemKindMax + 1> |
Definition at line 372 of file Protocol.h.
using clang::clangd::FileDigest = std::array<uint8_t, 8> |
Definition at line 42 of file SourceCode.h.
using clang::clangd::FileEdits = llvm::StringMap<Edit> |
A mapping from absolute file path (the one used for accessing the underlying VFS) to edits.
Definition at line 209 of file SourceCode.h.
using clang::clangd::HeaderFilter = llvm::ArrayRef<std::function<bool(llvm::StringRef)>> |
using clang::clangd::IncludeGraph = llvm::StringMap<IncludeGraphNode> |
A functor to create an index for an external index specification.
Functor should perform any high latency operation in a separate thread through AsyncTaskRunner, if set. Spec is never None.
Definition at line 24 of file ProjectAware.h.
Definition at line 321 of file Protocol.h.
using clang::clangd::Obj = llvm::json::Object |
Definition at line 217 of file LSPClient.cpp.
using clang::clangd::Path = std::string |
using clang::clangd::PathMappings = std::vector<PathMapping> |
Definition at line 42 of file PathMapping.h.
using clang::clangd::PathRef = llvm::StringRef |
Definition at line 130 of file Preamble.h.
using clang::clangd::RecursionProtectionSet = llvm::SmallPtrSet<const CXXRecordDecl *, 4> |
using clang::clangd::SlabTuple = std::tuple<SymbolSlab, RefSlab, RelationSlab> |
Definition at line 156 of file FileIndex.h.
using clang::clangd::SymbolKindBitset = std::bitset<SymbolKindMax + 1> |
Definition at line 411 of file Protocol.h.
Extracts system include search path from drivers matching QueryDriverGlobs and adds them to the compile flags.
Returns null when QueryDriverGlobs
is empty.
Definition at line 180 of file GlobalCompilationDatabase.h.
A factory to modify a tidy::ClangTidyOptions.
Definition at line 21 of file TidyProvider.h.
A factory to modify a tidy::ClangTidyOptions that doesn't hold any state.
Definition at line 27 of file TidyProvider.h.
typedef llvm::Registry<Tweak> clang::clangd::TweakRegistry |
typedef llvm::Registry<URIScheme> clang::clangd::URISchemeRegistry |
enum clang::clangd::CharRole : unsigned char |
Enumerator | |
---|---|
Unknown | |
Tail | |
Head | |
Separator |
Definition at line 55 of file FuzzyMatch.h.
enum clang::clangd::CharType : unsigned char |
Enumerator | |
---|---|
Empty | |
Lower | |
Upper | |
Punctuation |
Definition at line 41 of file FuzzyMatch.h.
|
strong |
The kind of a completion entry.
Definition at line 338 of file Protocol.h.
|
strong |
Definition at line 1225 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
TemplateInstantiation | This is the template instantiation that was referred to. e.g. template<> class vector<int> (the implicit specialization) |
TemplatePattern | This is the pattern the template specialization was instantiated from. e.g. class vector<T> (the pattern within the primary template) |
Alias | This declaration is an alias that was referred to. e.g. using ns::X (the UsingDecl directly referenced), using Z = ns::Y (the TypeAliasDecl directly referenced) |
Underlying | This is the underlying declaration for a renaming-alias, decltype etc. e.g. class ns::Y (the underlying declaration referenced). Note that we don't treat using ns::X as a first-class declaration like using Z = ns::Y. Therefore reference to X that goes through this using-decl is considered a direct reference (without the Underlying bit). Nevertheless, we report using ns::X as an Alias, so that some features like go-to-definition can still target it. |
Definition at line 95 of file FindTarget.h.
Definition at line 910 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Text | |
Read | |
Write |
Definition at line 1462 of file Protocol.h.
|
strong |
How to handle duplicated symbols across multiple files.
Enumerator | |
---|---|
PickOne | |
Merge |
Definition at line 50 of file FileIndex.h.
|
strong |
Enumerator | |
---|---|
ParseError | |
InvalidRequest | |
MethodNotFound | |
InvalidParams | |
InternalError | |
ServerNotInitialized | |
UnknownErrorCode | |
RequestCancelled | |
ContentModified |
Definition at line 47 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
NoShutdownRequest | |
CantRunAsXPCService | |
CheckFailed |
Definition at line 742 of file ClangdMain.cpp.
|
strong |
Enumerator | |
---|---|
Created | The file got created. |
Changed | The file got changed. |
Deleted | The file got deleted. |
Definition at line 812 of file Protocol.h.
|
strong |
Definition at line 31 of file SemanticHighlighting.h.
|
strong |
Definition at line 68 of file SemanticHighlighting.h.
|
strong |
Describes what data is covered by an index.
Indexes may contain symbols but not references from a file, etc. This affects merging: if a staler index contains a reference but a fresher one does not, we want to trust the fresher index only if it actually includes references in general.
Enumerator | |
---|---|
None | |
Symbols | |
References | |
Relations | |
All |
|
strong |
Enumerator | |
---|---|
RIFF | |
YAML |
Definition at line 37 of file Serialization.h.
|
strong |
Select between in-memory index implementations, which have tradeoffs.
Enumerator | |
---|---|
Light | |
Heavy |
Definition at line 42 of file FileIndex.h.
|
strong |
Inlay hint kinds.
Enumerator | |
---|---|
Type | An inlay hint that for a type annotation. An example of a type hint is a hint in this position: auto var ^ = expr; which shows the deduced type of the variable. |
Parameter | An inlay hint that is for a parameter. An example of a parameter hint is a hint in this position: func(^arg); which shows the name of the corresponding parameter. |
Designator | A hint before an element of an aggregate braced initializer list, indicating what it is initializing. Pair{^1, ^2}; Uses designator syntax, e.g. .first:. This is a clangd extension. |
BlockEnd | A hint after function, type or namespace definition, indicating the defined symbol name of the definition. An example of a decl name hint in this position: void func() { } ^ Uses comment-like syntax like "// func". This is a clangd extension. |
DefaultArgument | An inlay hint that is for a default argument. An example of a parameter hint for a default argument: void foo(bool A = true); foo(^); Adds an inlay hint "A: true". This is a clangd extension. |
Definition at line 1666 of file Protocol.h.
|
strong |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Enumerator | |
---|---|
Missing | |
PlainText | The primary text to be inserted is treated as a plain string. |
Snippet | The primary text to be inserted is treated as a snippet. A snippet can define tab stops and placeholders with $1, $2 and ${3:foo}. $0 defines the final tab stop, it defaults to the end of the snippet. Placeholders with equal identifiers are linked, that is typing in one will update others too. See also: https://github.com/Microsoft/vscode/blob/main/src/vs/editor/contrib/snippet/snippet.md |
Definition at line 1272 of file Protocol.h.
Enumerator | |
---|---|
Standard | |
Delimited |
Definition at line 66 of file Transport.h.
|
strong |
Enumerator | |
---|---|
StartsPPLine | Marks the token at the start of a logical preprocessor line. This is a position where a directive might start. Here, the first # is StartsPPLine, but second is not (same logical line). #define X(error) \ error // not a directive! Careful, the directive may not start exactly on the StartsPPLine token: /*comment*/ #include <foo.h> |
NeedsCleaning | Marks tokens containing trigraphs, escaped newlines, UCNs etc. The text() of such tokens will contain the raw trigrah. |
Definition at line 211 of file support/Token.h.
|
strong |
Enumerator | |
---|---|
PlainText | |
Markdown |
Definition at line 439 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 732 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
UnsupportedEncoding | |
UTF16 | |
UTF8 | |
UTF32 |
Definition at line 423 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Queued | |
Building | |
Idle |
Definition at line 119 of file TUScheduler.h.
|
strong |
|
strong |
Enumerator | |
---|---|
BaseOf | |
OverriddenBy |
Definition at line 20 of file Relation.h.
|
strong |
A symbol kind.
Definition at line 380 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Unknown | |
AST | |
Open | |
Static | |
Merge | |
Identifier | |
Remote | |
Preamble | |
Background | |
StdLib |
Definition at line 21 of file SymbolOrigin.h.
|
strong |
Enumerator | |
---|---|
Deprecated |
Definition at line 1575 of file Protocol.h.
|
strong |
Defines how the host (editor) should sync document changes to the language server.
Definition at line 325 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Off | |
Messages | |
Verbose |
Definition at line 309 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Children | |
Parents | |
Both |
Definition at line 1490 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 53 of file TUScheduler.h.
llvm::SmallString< 256 > clang::clangd::abbreviatedString | ( | DynTypedNode | N, |
const PrintingPolicy & | PP ) |
Definition at line 999 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.
Referenced by clangdMain().
Variant of parent_path that operates only on absolute paths.
Unlike parent_path doesn't consider C: a parent of C:.
Definition at line 22 of file Path.cpp.
Referenced by clang::clangd::config::Provider::fromAncestorRelativeYAMLFiles().
TidyProvider clang::clangd::addTidyChecks | ( | llvm::StringRef | Checks, |
llvm::StringRef | WarningsAsErrors ) |
Provider the enables a specific set of checks and warnings as errors.
Definition at line 187 of file TidyProvider.cpp.
References Checks(), mergeCheckList(), and WarningsAsErrors().
CompletionItemKind clang::clangd::adjustKindToCapability | ( | CompletionItemKind | Kind, |
CompletionItemKindBitset & | SupportedCompletionItemKinds ) |
Definition at line 1104 of file Protocol.cpp.
References Class, CompletionItemKindMin, Enum, EnumMember, File, Folder, Struct, and Text.
SymbolKind clang::clangd::adjustKindToCapability | ( | SymbolKind | Kind, |
SymbolKindBitset & | SupportedSymbolKinds ) |
Definition at line 280 of file Protocol.cpp.
References SymbolKindMin.
std::optional< std::vector< SymbolRange > > clang::clangd::adjustRenameRanges | ( | llvm::StringRef | DraftCode, |
const RenameSymbolName & | Name, | ||
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 1285 of file Rename.cpp.
References getMappedRanges().
void clang::clangd::allowCrashPragmasForTest | ( | ) |
Respect #pragma clang __debug crash etc, which are usually disabled.
This may only be called before threads are spawned.
Definition at line 44 of file Compiler.cpp.
References AllowCrashPragmasForTest.
Referenced by clangdMain().
bool clang::clangd::allowImplicitCompletion | ( | llvm::StringRef | Content, |
unsigned | Offset ) |
Definition at line 2470 of file CodeComplete.cpp.
References isIncludeFile().
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > clang::clangd::allTargetDecls | ( | const DynTypedNode & | , |
const HeuristicResolver * | ) |
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along with their DeclRelationSets.
This is suitable for indexing, where everything is recorded and filtering is applied later.
Definition at line 536 of file FindTarget.cpp.
References dlog.
Referenced by explicitReferenceTargets(), and targetDecl().
llvm::Error clang::clangd::applyChange | ( | std::string & | Contents, |
const TextDocumentContentChangeEvent & | Change ) |
Apply an incremental update to a text document.
Definition at line 1122 of file SourceCode.cpp.
References error(), inferFinalNewline(), lspLength(), positionToOffset(), clang::clangd::TextDocumentContentChangeEvent::range, clang::clangd::TextDocumentContentChangeEvent::rangeLength, and clang::clangd::TextDocumentContentChangeEvent::text.
void clang::clangd::applyPathMappings | ( | llvm::json::Value & | Params, |
PathMapping::Direction | Dir, | ||
const PathMappings & | Mappings ) |
Applies the Mappings
to all the file:// URIs in Params
.
NOTE: The first matching mapping will be applied, otherwise Params
will be untouched.
Definition at line 48 of file PathMapping.cpp.
References applyPathMappings(), and doPathMapping().
Referenced by applyPathMappings().
|
static |
Definition at line 1048 of file ClangdLSPServer.cpp.
References asCommand(), clang::clangd::CodeAction::command, clang::clangd::CodeAction::edit, clang::clangd::CodeAction::kind, clang::clangd::CodeAction::QUICKFIX_KIND, and clang::clangd::CodeAction::title.
Referenced by asCommand().
std::unique_ptr< CompilerInvocation > clang::clangd::buildCompilerInvocation | ( | const ParseInputs & | Inputs, |
clang::DiagnosticConsumer & | D, | ||
std::vector< std::string > * | CC1Args ) |
Builds compiler invocation that could be used to build AST or preamble.
Definition at line 95 of file Compiler.cpp.
References clang::clangd::ParseInputs::CompileCommand, disableUnsupportedOptions(), 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, | ||
PreambleBuildStats * | Stats = nullptr ) |
Build a preamble for the new inputs unless an old one can be reused.
If PreambleCallback
is set, it will be run on top of the AST while building the preamble. If Stats is not non-null, build statistics will be exported there.
Definition at line 591 of file Preamble.cpp.
References clang::clangd::ModulesBuilder::buildPrerequisiteModulesFor(), clang::clangd::ParseInputs::CompileCommand, clang::clangd::ParseInputs::Contents, clang::clangd::Config::current(), clang::clangd::Config::Diagnostics, elog(), clang::clangd::ParseInputs::FeatureModules, clang::clangd::PreambleBuildStats::FileSystemTime, Info, isDiagnosticSuppressed(), log(), clang::clangd::ParseInputs::ModulesManager, clang::clangd::ParseInputs::Opts, clang::clangd::ParseOptions::PreambleParseForwardingFunctions, clang::clangd::PreambleBuildStats::SerializedSize, clang::clangd::StoreDiags::setDiagCallback(), clang::clangd::StoreDiags::setLevelAdjuster(), SPAN_ATTACH, clang::clangd::Config::Suppress, clang::clangd::Config::SuppressAll, clang::clangd::StoreDiags::take(), clang::clangd::ParseInputs::TFS, clang::clangd::PreambleBuildStats::TotalBuildTime, clang::clangd::ParseInputs::Version, and clang::clangd::ThreadsafeFS::view().
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< SymbolRange > | Occurrences, | ||
llvm::ArrayRef< llvm::StringRef > | NewNames ) |
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 1202 of file Rename.cpp.
References clang::clangd::Position::character, clang::clangd::Range::end, error(), clang::clangd::Position::line, positionToOffset(), SPAN_ATTACH, and clang::clangd::Range::start.
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > clang::clangd::buildTestFS | ( | llvm::StringMap< std::string > const & | Files, |
llvm::StringMap< time_t > const & | Timestamps ) |
Definition at line 33 of file TestFS.cpp.
References File, and testRoot().
Referenced by clang::clangd::MockFS::viewImpl().
CharTypeSet clang::clangd::calculateRoles | ( | llvm::StringRef | Text, |
llvm::MutableArrayRef< CharRole > | Roles ) |
Definition at line 154 of file FuzzyMatch.cpp.
References CharRoles, CharTypes, Empty, packedLookup(), Text, and Type.
Referenced by collectWords(), clang::clangd::FuzzyMatcher::FuzzyMatcher(), clang::clangd::dex::generateQueryTrigrams(), 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(), and StateKey.
|
static |
Definition at line 49 of file FileDistance.cpp.
Referenced by clang::clangd::FileDistance::distance(), and clang::clangd::FileDistance::FileDistance().
|
static |
Definition at line 83 of file Quality.cpp.
References categorize(), clang::clangd::SymbolQualitySignals::Constructor, clang::clangd::SymbolQualitySignals::Function, clang::clangd::SymbolQualitySignals::Keyword, clang::clangd::SymbolQualitySignals::Macro, clang::clangd::SymbolQualitySignals::Namespace, clang::clangd::SymbolQualitySignals::Type, and clang::clangd::SymbolQualitySignals::Variable.
|
static |
Definition at line 109 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Constructor, clang::clangd::SymbolQualitySignals::Destructor, clang::clangd::SymbolQualitySignals::Function, clang::clangd::SymbolQualitySignals::Macro, clang::clangd::SymbolQualitySignals::Namespace, clang::clangd::SymbolQualitySignals::Type, clang::clangd::SymbolQualitySignals::Unknown, and clang::clangd::SymbolQualitySignals::Variable.
|
static |
Definition at line 53 of file Quality.cpp.
References Constructor, Function, MAP, Namespace, clang::clangd::SymbolQualitySignals::Operator, Type, Unknown, and Variable.
Referenced by categorize(), clang::clangd::SymbolQualitySignals::merge(), and clang::clangd::SymbolQualitySignals::merge().
bool clang::clangd::check | ( | llvm::StringRef | File, |
const ThreadsafeFS & | TFS, | ||
const ClangdLSPServer::Options & | Opts ) |
Definition at line 462 of file Check.cpp.
References check(), clang::clangd::config::Fragment::DiagnosticsBlock::ClangTidy, clang::clangd::config::Provider::combine(), clang::clangd::ClangdLSPServer::Options::ConfigProvider, clang::clangd::ClangdServer::createConfiguredContextProvider(), clang::clangd::config::Fragment::Diagnostics, elog(), clang::clangd::config::Fragment::DiagnosticsBlock::ClangTidyBlock::FastCheckFilter, File, log(), and ParseError.
Referenced by check(), and clangdMain().
void clang::clangd::chooseConditionalBranches | ( | DirectiveTree & | , |
const TokenStream & | Code ) |
Describes the structure of a source file, as seen by the preprocessor.
The structure is a tree, whose leaves are plain source code and directives, and whose internal nodes are #if...#endif sections.
(root) |-+ Directive #include <stdio.h> |-+ Code int main() { | printf("hello, "); / |-+ Conditional -+ Directive #ifndef NDEBUG / | |-+ Code printf("debug\n"); / | |-+ Directive #else / | |-+ Code printf("production\n"); / | -+ Directive #endif |-+ Code return 0; } / / Unlike the clang preprocessor, we model the full tree explicitly. / This class does not recognize macro usage, only directives. struct DirectiveTree { / A range of code (and possibly comments) containing no directives. struct Code { Token::Range Tokens; }; / A preprocessor directive. struct Directive { / Raw tokens making up the directive, starting with #. Token::Range Tokens; clang::tok::PPKeywordKind Kind = clang::tok::pp_not_keyword; }; / A preprocessor conditional section. / / This starts with an #if, #ifdef, #ifndef etc directive. / It covers all #else branches, and spans until the matching #endif. struct Conditional { / The sequence of directives that introduce top-level alternative parses. / / The first branch will have an #if type directive. / Subsequent branches will have #else type directives. std::vector<std::pair<Directive, DirectiveTree>> Branches; / The directive terminating the conditional, should be #endif. Directive End; / The index of the conditional branch we chose as active. / std::nullopt indicates no branch was taken (e.g. #if 0 ... #endif). / The initial tree from parse() has no branches marked as taken. / See chooseConditionalBranches()`. std::optional<unsigned> Taken; };
/ Some piece of the file. {One of Code, Directive, Conditional}. using Chunk = std::variant<Code, Directive, Conditional>; std::vector<Chunk> Chunks;
/ Extract preprocessor structure by examining the raw tokens. static DirectiveTree parse(const TokenStream &);
/ Produce a parseable token stream by stripping all directive tokens. / / Conditional sections are replaced by the taken branch, if any. / This tree must describe the provided token stream. TokenStream stripDirectives(const TokenStream &) const; }; llvm::raw_ostream &operator<<(llvm::raw_ostream &, const DirectiveTree &); llvm::raw_ostream &operator<<(llvm::raw_ostream &, const DirectiveTree::Code &); llvm::raw_ostream &operator<<(llvm::raw_ostream &, const DirectiveTree::Directive &); llvm::raw_ostream &operator<<(llvm::raw_ostream &, const DirectiveTree::Conditional &);
/ Selects a "taken" branch for each conditional directive in the file. / / The choice is somewhat arbitrary, but aims to produce a useful parse: / - idioms like #if 0 are respected / - we avoid paths that reach #error
Choices are also made for conditionals themselves inside not-taken branches: #if 1 // taken! #else // not taken #if 1 // taken! #endif #endif
The choices are stored in Conditional::Taken nodes.
Definition at line 318 of file DirectiveTree.cpp.
Referenced by getFoldingRanges().
int clang::clangd::clangdMain | ( | int | argc, |
char * | argv[] ) |
Definition at line 748 of file ClangdMain.cpp.
References abortAfterTimeout(), allowCrashPragmasForTest(), clang::clangd::ClangdServer::Options::AsyncThreadsCount, clang::clangd::ClangdServer::Options::BackgroundIndex, clang::clangd::ClangdServer::Options::BackgroundIndexPriority, clang::clangd::ClangdServer::Options::BuildDynamicSymbolIndex, CantRunAsXPCService, check(), CheckFailed, clang::clangd::ClangdServer::Options::ClangTidyProvider, clang::clangd::ClangdLSPServer::Options::CodeComplete, combine(), clang::clangd::config::Provider::combine(), clang::clangd::ClangdLSPServer::Options::ConfigProvider, clang::clangd::trace::createCSVMetricTracer(), clang::clangd::trace::createJSONTracer(), createPathMappingTransport(), createProjectAwareIndex(), Delimited, disableUnusableChecks(), elog(), clang::clangd::ClangdLSPServer::Options::EnableExperimentalModulesSupport, clang::clangd::ClangdServer::Options::EnableOutgoingCalls, clang::clangd::ClangdLSPServer::Options::Encoding, Error, featureString(), clang::clangd::config::Provider::fromAncestorRelativeYAMLFiles(), clang::clangd::config::Provider::fromYAMLFile(), clang::clangd::ClangdServer::Options::ImportInsertions, clang::clangd::RenameOptions::LimitFiles, log(), clang::clangd::ClangdLSPServer::Options::MemoryCleanup, newJSONTransport(), newXPCTransport(), NoShutdownRequest, parsePathMappings(), platformString(), clang::clangd::ClangdServer::Options::PreambleParseForwardingFunctions, clang::clangd::BackgroundQueue::preventThreadStarvationInTests(), provideClangdConfig(), provideClangTidyFiles(), provideDefaultChecks(), provideEnvironment(), clang::clangd::ClangdServer::Options::QueryDriverGlobs, clang::clangd::ClangdLSPServer::Options::ReferencesLimit, clang::clangd::ClangdLSPServer::Options::Rename, requestShutdown(), clang::clangd::ClangdServer::Options::ResourceDir, clang::clangd::ClangdLSPServer::run(), clang::clangd::ThreadCrashReporter::runCrashHandlers(), clang::clangd::ClangdServer::Options::StaticIndex, clang::clangd::ClangdServer::Options::StorePreamblesInMemory, clang::clangd::ClangdLSPServer::Options::TweakFilter, UnsupportedEncoding, clang::clangd::ClangdLSPServer::Options::UseDirBasedCDB, clang::clangd::ClangdServer::Options::UseDirtyHeaders, clang::clangd::Logger::Verbose, versionString(), vlog(), and X().
Referenced by main().
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 612 of file SourceCode.cpp.
Referenced by reformatEdit().
Symbol clang::clangd::cls | ( | llvm::StringRef | Name | ) |
Definition at line 66 of file TestIndex.cpp.
References sym().
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 2269 of file CodeComplete.cpp.
References codeCompleteComment(), clang::clangd::ParseInputs::Contents, clang::clangd::PreamblePatch::createMacroPatch(), elog(), maybeFunctionArgumentCommentStart(), positionToOffset(), Preamble, and clang::clangd::ParseInputs::TFS.
Referenced by clang::clangd::ClangdServer::codeComplete().
CodeCompleteResult clang::clangd::codeCompleteComment | ( | PathRef | FileName, |
unsigned | Offset, | ||
llvm::StringRef | Prefix, | ||
const PreambleData * | Preamble, | ||
const ParseInputs & | ParseInput ) |
Definition at line 2209 of file CodeComplete.cpp.
References AST, clang::clangd::ParseInputs::Contents, clang::clangd::PreamblePatch::createFullPatch(), clang::clangd::Range::end, offsetToPosition(), Preamble, clang::clangd::Range::start, and Text.
Referenced by codeComplete().
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 468 of file clangd/IncludeFixer.cpp.
References printNamespaceScope().
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo().
std::vector< Range > clang::clangd::collectIdentifierRanges | ( | llvm::StringRef | Identifier, |
llvm::StringRef | Content, | ||
const LangOptions & | LangOpts ) |
Collects all ranges of the given identifier in the source code.
Definition at line 646 of file SourceCode.cpp.
References halfOpenToRange(), Identifier, and lex().
llvm::StringMap< unsigned > clang::clangd::collectIdentifiers | ( | llvm::StringRef | Content, |
const format::FormatStyle & | Style ) |
Collects identifiers with counts in the source code.
Definition at line 632 of file SourceCode.cpp.
std::vector< include_cleaner::SymbolReference > clang::clangd::collectMacroReferences | ( | ParsedAST & | AST | ) |
Definition at line 317 of file IncludeCleaner.cpp.
References AST, locateMacroAt(), and Macro.
Referenced by computeIncludeCleanerFindings().
std::unique_ptr< PPCallbacks > clang::clangd::collectPragmaMarksCallback | ( | const SourceManager & | SM, |
std::vector< PragmaMark > & | Out ) |
Collect all pragma marks from the main file.
Definition at line 129 of file CollectMacros.cpp.
Referenced by clang::clangd::ParsedAST::build().
llvm::StringSet clang::clangd::collectWords | ( | llvm::StringRef | Content | ) |
Collects words from the source code.
Unlike collectIdentifiers:
Definition at line 871 of file SourceCode.cpp.
References calculateRoles(), Head, Separator, Tail, and Unknown.
TidyProvider clang::clangd::combine | ( | std::vector< TidyProvider > | Providers | ) |
Definition at line 275 of file TidyProvider.cpp.
Referenced by clangdMain().
IncludeCleanerFindings clang::clangd::computeIncludeCleanerFindings | ( | ParsedAST & | AST, |
bool | AnalyzeAngledIncludes ) |
Definition at line 378 of file IncludeCleaner.cpp.
References AST, collectMacroReferences(), convertIncludes(), and clang::clangd::PreamblePatch::getPatchEntry().
|
static |
Definition at line 261 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().
Symbol clang::clangd::conceptSym | ( | llvm::StringRef | Name | ) |
Definition at line 86 of file TestIndex.cpp.
References sym().
include_cleaner::Includes clang::clangd::convertIncludes | ( | const ParsedAST & | AST | ) |
Converts the clangd include representation to include-cleaner include representation.
Definition at line 345 of file IncludeCleaner.cpp.
Referenced by computeIncludeCleanerFindings().
TokenStream clang::clangd::cook | ( | const TokenStream & | , |
const clang::LangOptions & | ) |
Decoding raw tokens written in the source code, returning a derived stream.
The StartsPPLine flag is preserved.
Formally the identifier correctly happens before preprocessing, while we should only cook raw_identifiers that survive preprocessing. However, ignoring the Token::Kind of tokens in directives achieves the same. (And having cooked token kinds in PP-disabled sections is useful for us).
TokenStream clang::clangd::cook | ( | const TokenStream & | Code, |
const LangOptions & | LangOpts ) |
Definition at line 79 of file Lex.cpp.
References clang::clangd::TokenStream::addPayload(), clang::clangd::TokenStream::finalize(), clang::clangd::TokenStream::getPayload(), NeedsCleaning, clang::clangd::TokenStream::push(), Text, and clang::clangd::TokenStream::tokens().
Referenced by getFoldingRanges().
std::unique_ptr< SymbolIndex > clang::clangd::createIndex | ( | ) |
Definition at line 29 of file ProjectAwareIndexTests.cpp.
References clang::clangd::MemIndex::build(), clang::clangd::SymbolSlab::Builder::insert(), and symbol().
std::unique_ptr< Transport > clang::clangd::createPathMappingTransport | ( | std::unique_ptr< Transport > | Transp, |
PathMappings | Mappings ) |
Creates a wrapping transport over Transp
that applies the Mappings
to all inbound and outbound LSP messages.
All calls are then delegated to the regular transport (e.g. XPC, JSON).
Definition at line 190 of file PathMapping.cpp.
Referenced by clangdMain().
std::unique_ptr< SymbolIndex > clang::clangd::createProjectAwareIndex | ( | IndexFactory | , |
bool | Sync ) |
Returns an index that answers queries using external indices.
IndexFactory specifies how to generate an index from an external source. If Sync
is set, index won't own any asnyc task runner. IndexFactory must be injected because this code cannot depend on the remote index client.
Definition at line 148 of file ProjectAware.cpp.
Referenced by clangdMain(), TEST(), and TEST().
|
static |
Definition at line 188 of file FileDistance.cpp.
References clang::clangd::FileDistanceOptions::AllowDownTraversalFromRoot, clang::clangd::SourceParams::Cost, createScopeFileDistance(), clang::clangd::FileDistanceOptions::DownCost, clang::clangd::SourceParams::MaxUpTraversals, scopeToPath(), and clang::clangd::FileDistanceOptions::UpCost.
Referenced by createScopeFileDistance(), and clang::clangd::ScopeDistance::ScopeDistance().
std::unique_ptr< FrontendAction > clang::clangd::createStaticIndexingAction | ( | SymbolCollector::Options | Opts, |
std::function< void(SymbolSlab)> | SymbolsCallback, | ||
std::function< void(RefSlab)> | RefsCallback, | ||
std::function< void(RelationSlab)> | RelationsCallback, | ||
std::function< void(IncludeGraph)> | IncludeGraphCallback ) |
Definition at line 212 of file IndexAction.cpp.
References All, clang::clangd::SymbolCollector::Options::CollectIncludePath, clang::clangd::SymbolCollector::Options::Origin, clang::clangd::SymbolCollector::Options::PragmaIncludes, clang::clangd::SymbolCollector::Options::RefFilter, clang::clangd::SymbolCollector::Options::RefsInHeaders, Static, clang::clangd::SymbolCollector::Options::StoreAllDocumentation, and Unknown.
|
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 |
Definition at line 1808 of file XRefs.cpp.
References declToCallHierarchyItem(), declToHierarchyItem(), Deprecated, and getSymbolID().
Referenced by declToCallHierarchyItem(), and prepareCallHierarchy().
|
static |
Definition at line 1749 of file XRefs.cpp.
References clang::clangd::URIForFile::canonicalize(), declToHierarchyItem(), getCanonicalPath(), indexSymbolKindToSymbolKind(), nameLocation(), printName(), sourceLocToPosition(), and toHalfOpenFileRange().
Referenced by declToCallHierarchyItem(), declToHierarchyItem(), and declToTypeHierarchyItem().
|
static |
Definition at line 1794 of file XRefs.cpp.
References declToHierarchyItem(), declToTypeHierarchyItem(), and getSymbolID().
Referenced by declToTypeHierarchyItem(), fillSuperTypes(), and getTypeHierarchy().
void clang::clangd::deleteModuleCache | ( | const std::string | ModuleCachePath | ) |
Definition at line 91 of file TestTU.cpp.
Referenced by clang::clangd::TestTU::build(), and clang::clangd::TestTU::preamble().
std::vector< SemanticTokensEdit > clang::clangd::diffTokens | ( | llvm::ArrayRef< SemanticToken > | Old, |
llvm::ArrayRef< SemanticToken > | New ) |
Definition at line 1509 of file SemanticHighlighting.cpp.
FileDigest clang::clangd::digest | ( | llvm::StringRef | Content | ) |
Definition at line 565 of file SourceCode.cpp.
Referenced by digestFile().
FileDigest clang::clangd::digest | ( | StringRef | Content | ) |
References kCurrentOffsetEncoding.
std::optional< FileDigest > clang::clangd::digestFile | ( | const SourceManager & | SM, |
FileID | FID ) |
Definition at line 575 of file SourceCode.cpp.
References digest().
void clang::clangd::disableUnsupportedOptions | ( | CompilerInvocation & | CI | ) |
Clears CI
from options that are not supported by clangd, like codegen or plugins.
This should be combined with CommandMangler::adjust, which provides similar functionality for options that needs to be stripped from compile flags.
Definition at line 46 of file Compiler.cpp.
References AllowCrashPragmasForTest.
Referenced by buildCompilerInvocation().
TidyProvider clang::clangd::disableUnusableChecks | ( | llvm::ArrayRef< std::string > | ExtraBadChecks = {} | ) |
Provider that will disable checks known to not work with clangd.
ExtraBadChecks
specifies any other checks that should be always disabled.
Definition at line 197 of file TidyProvider.cpp.
References clang::tidy::ClangTidyOptions::Checks, and Separator.
Referenced by clangdMain().
std::optional< std::string > clang::clangd::doPathMapping | ( | llvm::StringRef | S, |
PathMapping::Direction | Dir, | ||
const PathMappings & | Mappings ) |
Returns a modified S
with the first matching path in Mappings
substituted, if applicable.
Definition at line 20 of file PathMapping.cpp.
References clang::clangd::PathMapping::ClientToServer, clang::clangd::URI::parse(), and clang::clangd::URI::toString().
Referenced by applyPathMappings().
ASTNode clang::clangd::dumpAST | ( | const DynTypedNode & | N, |
const syntax::TokenBuffer & | Tokens, | ||
const ASTContext & | Ctx ) |
Definition at line 408 of file DumpAST.cpp.
References elog().
Referenced by clang::clangd::ClangdServer::getAST().
void clang::clangd::elog | ( | const char * | Fmt, |
Ts &&... | Vals ) |
Definition at line 61 of file Logger.h.
References clang::clangd::Logger::Error, and clang::clangd::detail::log().
Referenced by clang::clangd::ClangdLSPServer::MessageHandler::bindReply(), clang::clangd::ParsedAST::build(), buildPreamble(), clang::clangd::ModulesBuilder::buildPrerequisiteModulesFor(), clang::clangd::IncludeInserter::calculateIncludePath(), clang::clangd::URIForFile::canonicalize(), clangdMain(), codeComplete(), convertIncludes(), dumpAST(), findImplementations(), formatIncremental(), fromJSON(), fromJSON(), getCanonicalPath(), getCorrespondingHeaderOrSource(), getInactiveRegions(), indexStandardLibrary(), iterateCodepoints(), loadIndex(), locateSymbolAt(), main(), main(), clang::clangd::ClangdLSPServer::MessageHandler::onCall(), clang::clangd::ClangdLSPServer::MessageHandler::onNotify(), clang::clangd::ClangdLSPServer::MessageHandler::onReply(), clang::clangd::ClangdLSPServer::run(), signatureHelp(), clang::clangd::ThreadsafeFS::view(), and xpcToJson().
|
static |
Definition at line 540 of file Quality.cpp.
Referenced by sortText().
|
static |
Definition at line 1285 of file Protocol.cpp.
References SemanticTokenEncodingSize.
Symbol clang::clangd::enm | ( | llvm::StringRef | Name | ) |
Definition at line 70 of file TestIndex.cpp.
References sym().
Symbol clang::clangd::enmConstant | ( | llvm::StringRef | Name | ) |
Definition at line 74 of file TestIndex.cpp.
References sym().
llvm::Error clang::clangd::error | ( | const char * | Fmt, |
Ts &&... | Vals ) |
Definition at line 85 of file Logger.h.
References clang::clangd::detail::error(), and clang::clangd::detail::wrap().
llvm::Error clang::clangd::error | ( | std::error_code | EC, |
const char * | Fmt, | ||
Ts &&... | Vals ) |
Definition at line 79 of file Logger.h.
References clang::clangd::detail::error(), and clang::clangd::detail::wrap().
Referenced by applyChange(), clang::clangd::ClangdLSPServer::MessageHandler::bindReply(), buildRenameEdit(), clang::clangd::URI::create(), clang::clangd::Tweak::Effect::fileEdit(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::SymbolID::fromStr(), clang::clangd::TestScheme::getAbsolutePath(), indexToLSPLocation(), insertDecl(), insertDecl(), clang::clangd::URI::parse(), parsePathMappings(), positionToOffset(), prepareTweak(), clang::clangd::riff::readChunk(), clang::clangd::riff::readFile(), readIndexFile(), clang::clangd::remote::Marshaller::relativePathToURI(), clang::clangd::ClangdServer::signatureHelp(), clang::clangd::TestScheme::uriFromAbsolutePath(), and clang::clangd::remote::Marshaller::uriToRelativePath().
|
inline |
Definition at line 91 of file Logger.h.
References clang::clangd::detail::error().
|
inline |
Definition at line 95 of file Logger.h.
References clang::clangd::detail::error().
void clang::clangd::escapeBackslashAndQuotes | ( | llvm::StringRef | Text, |
llvm::raw_ostream & | OS ) |
Definition at line 759 of file Preamble.cpp.
References Text.
DecisionForestScores clang::clangd::evaluateDecisionForest | ( | const SymbolQualitySignals & | Quality, |
const SymbolRelevanceSignals & | Relevance, | ||
float | Base ) |
Definition at line 18 of file DecisionForest.cpp.
float clang::clangd::evaluateSymbolAndRelevance | ( | float | SymbolQuality, |
float | SymbolRelevance ) |
Combine symbol quality and relevance into a single score.
Definition at line 534 of file Quality.cpp.
Referenced by getWorkspaceSymbols(), and locateSymbolTextually().
llvm::SmallVector< const NamedDecl *, 1 > clang::clangd::explicitReferenceTargets | ( | DynTypedNode | N, |
DeclRelationSet | Mask, | ||
const HeuristicResolver * | Resolver ) |
Find declarations explicitly referenced in the source code defined by N
.
For templates, will prefer to return a template instantiation whenever possible. However, can also return a template pattern if the specialization cannot be picked, e.g. in dependent code or when there is no corresponding Decl for a template instantiation, e.g. for templated using decls: template <class T> using Ptr = T*; Ptr<int> x; ^~~ there is no Decl for 'Ptr<int>', so we return the template pattern. Mask
should not contain TemplatePattern or TemplateInstantiation.
Definition at line 577 of file FindTarget.cpp.
References allTargetDecls(), TemplateInstantiation, and TemplatePattern.
Referenced by findRecordTypeAt(), and getHover().
std::optional< CheapUnresolvedName > clang::clangd::extractUnresolvedNameCheaply | ( | const SourceManager & | SM, |
const DeclarationNameInfo & | Unresolved, | ||
CXXScopeSpec * | SS, | ||
const LangOptions & | LangOpts, | ||
bool | UnresolvedIsSpecifier ) |
Definition at line 397 of file clangd/IncludeFixer.cpp.
References getSpelledSpecifier(), clang::clangd::CheapUnresolvedName::Name, printNamespaceScope(), qualifiedByUnresolved(), clang::clangd::CheapUnresolvedName::ResolvedScope, splitQualifiedName(), and clang::clangd::CheapUnresolvedName::UnresolvedScope.
Referenced by clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo().
std::string clang::clangd::featureString | ( | ) |
Definition at line 33 of file Feature.cpp.
Referenced by clangdMain().
|
static |
Definition at line 153 of file Background.cpp.
Referenced by clang::clangd::BackgroundIndex::boostRelated().
|
static |
Definition at line 356 of file Quality.cpp.
References clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluateHeuristics(), and operator<<().
|
static |
Fills D
with all information, except the location-related bits.
Also note that ID and Name are not part of clangd::DiagBase and should be set elsewhere.
Definition at line 668 of file Diagnostics.cpp.
References Info.
Referenced by clang::clangd::StoreDiags::HandleDiagnostic().
|
static |
Definition at line 1861 of file XRefs.cpp.
References BaseOf, fillSubTypes(), Object, clang::clangd::RelationsRequest::Predicate, clang::clangd::SymbolIndex::relations(), clang::clangd::RelationsRequest::Subjects, and symbolToTypeHierarchyItem().
Referenced by fillSubTypes(), getTypeHierarchy(), resolveTypeHierarchy(), and subTypes().
|
static |
Definition at line 1882 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::data, declToTypeHierarchyItem(), fillSuperTypes(), clang::clangd::TypeHierarchyItem::parents, clang::clangd::TypeHierarchyItem::ResolveParams::parents, and typeParents().
Referenced by fillSuperTypes(), and getTypeHierarchy().
const NamedDecl & clang::clangd::findDecl | ( | ParsedAST & | AST, |
llvm::StringRef | QName ) |
const NamedDecl & clang::clangd::findDecl | ( | ParsedAST & | AST, |
std::function< bool(const NamedDecl &)> | Filter ) |
Definition at line 240 of file TestTU.cpp.
References AST.
std::vector< DocumentHighlight > clang::clangd::findDocumentHighlights | ( | ParsedAST & | AST, |
Position | Pos ) |
Returns highlights for all usages of a symbol at Pos
.
Definition at line 1277 of file XRefs.cpp.
References Alias, AST, clang::clangd::SelectionTree::createEach(), sourceLocationInMainFile(), targetDecl(), and TemplatePattern.
Referenced by clang::clangd::ClangdServer::findDocumentHighlights().
void clang::clangd::findExplicitReferences | ( | const ASTContext & | AST, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver ) |
Definition at line 1142 of file FindTarget.cpp.
References AST.
void clang::clangd::findExplicitReferences | ( | const Decl * | D, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver ) |
Definition at line 1136 of file FindTarget.cpp.
void clang::clangd::findExplicitReferences | ( | const Stmt * | S, |
llvm::function_ref< void(ReferenceLoc)> | Out, | ||
const HeuristicResolver * | Resolver ) |
Recursively traverse S
and report all references explicitly written in the code.
The main use-case is refactorings that need to process all references in some subrange of the file and apply simple edits, e.g. add qualifiers. FIXME: currently this does not report references to overloaded operators. FIXME: extend to report location information about declaration names too.
Definition at line 1130 of file FindTarget.cpp.
Referenced by clang::clangd::ASTSignals::derive(), getNonLocalDeclRefs(), and getSemanticHighlightings().
std::vector< LocatedSymbol > clang::clangd::findImplementations | ( | ParsedAST & | AST, |
Position | Pos, | ||
const SymbolIndex * | Index ) |
Returns implementations at a specified Pos:
Definition at line 1318 of file XRefs.cpp.
References Alias, AST, BaseOf, elog(), getSymbolID(), OverriddenBy, sourceLocationInMainFile(), and TemplatePattern.
Referenced by clang::clangd::ClangdServer::findImplementations().
const syntax::Token * clang::clangd::findNearbyIdentifier | ( | const SpelledWord & | Word, |
const syntax::TokenBuffer & | TB ) |
Definition at line 685 of file XRefs.cpp.
References clang::clangd::SpelledWord::ExpandedToken, File, clang::clangd::SpelledWord::Location, clang::clangd::SpelledWord::PartOfSpelledToken, clang::clangd::SpelledWord::Text, and vlog().
Referenced by locateSymbolAt().
std::vector< const CXXRecordDecl * > clang::clangd::findRecordTypeAt | ( | ParsedAST & | AST, |
Position | Pos ) |
Find the record types referenced at Pos
.
Definition at line 1913 of file XRefs.cpp.
References AST, clang::clangd::SelectionTree::createEach(), explicitReferenceTargets(), findRecordTypeAt(), Method, positionToOffset(), and Underlying.
Referenced by findRecordTypeAt(), and getTypeHierarchy().
ReferencesResult clang::clangd::findReferences | ( | ParsedAST & | AST, |
Position | Pos, | ||
uint32_t | Limit, | ||
const SymbolIndex * | Index = nullptr, | ||
bool | AddContext = false ) |
Returns references of the symbol at a specified Pos
.
Limit
limits the number of results returned (0 means no limit).
Definition at line 1443 of file XRefs.cpp.
References Alias, AST, clang::clangd::ReferencesResult::Reference::Attributes, clang::clangd::URIForFile::canonicalize(), clang::clangd::Ref::Container, clang::clangd::ReferenceLocation::containerName, clang::clangd::ReferencesResult::Declaration, Declaration, clang::clangd::ReferencesResult::Definition, Definition, findReferences(), getSymbolID(), clang::clangd::ReferencesResult::HasMore, clang::clangd::LookupRequest::IDs, clang::clangd::RefsRequest::IDs, clang::clangd::Ref::Kind, clang::clangd::RefsRequest::Limit, clang::clangd::ReferencesResult::Reference::Loc, locateMacroAt(), clang::clangd::Ref::Location, clang::clangd::SymbolIndex::lookup(), Macro, Object, OverriddenBy, clang::clangd::ReferencesResult::Override, clang::clangd::Location::range, clang::clangd::ReferencesResult::References, clang::clangd::SymbolIndex::refs(), clang::clangd::SymbolIndex::relations(), sourceLocationInMainFile(), TemplatePattern, and clang::clangd::Location::uri.
Referenced by clang::clangd::ClangdServer::findReferences(), and findReferences().
const Symbol & clang::clangd::findSymbol | ( | const SymbolSlab & | Slab, |
llvm::StringRef | QName ) |
Definition at line 186 of file TestTU.cpp.
std::vector< LocatedSymbol > clang::clangd::findType | ( | ParsedAST & | AST, |
Position | Pos, | ||
const SymbolIndex * | Index ) |
Returns symbols for types referenced at Pos
.
For example, given b^ar() wher bar return Foo, this function returns the definition of class Foo.
Definition at line 2144 of file XRefs.cpp.
References AST, clang::clangd::SelectionTree::createEach(), elog(), findType(), positionToOffset(), Type, typeForNode(), and unwrapFindType().
Referenced by clang::clangd::ClangdServer::findType(), and findType().
const NamedDecl & clang::clangd::findUnqualifiedDecl | ( | ParsedAST & | AST, |
llvm::StringRef | Name ) |
Definition at line 261 of file TestTU.cpp.
References AST, and findDecl().
|
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 1003 of file ClangdLSPServer.cpp.
References clang::clangd::DocumentSymbol::children, clang::clangd::SymbolInformation::containerName, flattenSymbolHierarchy(), clang::clangd::DocumentSymbol::kind, clang::clangd::SymbolInformation::kind, clang::clangd::SymbolInformation::location, clang::clangd::DocumentSymbol::name, clang::clangd::SymbolInformation::name, clang::clangd::DocumentSymbol::range, clang::clangd::Location::range, Symbols, and clang::clangd::Location::uri.
Referenced by flattenSymbolHierarchy().
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 326 of file CodeCompletionStrings.cpp.
std::vector< tooling::Replacement > clang::clangd::formatIncremental | ( | llvm::StringRef | Code, |
unsigned | Cursor, | ||
llvm::StringRef | InsertedText, | ||
format::FormatStyle | Style ) |
Applies limited formatting around new InsertedText
.
The Code
already contains the updated text before Cursor
, and may have had additional / characters (such as indentation) inserted by the editor.
Example breaking a line (^ is the cursor): === before newline is typed === if(1){^} === after newline is typed and editor indents === if(1){ ^} === after formatIncremental(InsertedText="\n") === if (1) { ^ }
We return sorted vector<tooling::Replacement>, not tooling::Replacements! We may insert text both before and after the cursor. tooling::Replacements would merge these, and thus lose information about cursor position.
Definition at line 277 of file Format.cpp.
References dlog, elog(), Incremental, and vlog().
Referenced by clang::clangd::ClangdServer::formatOnType().
|
static |
Definition at line 1390 of file Hover.cpp.
References formatSize().
|
static |
Definition at line 1382 of file Hover.cpp.
Referenced by formatOffset().
|
inline |
Definition at line 318 of file Protocol.h.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKind & | Out, | ||
llvm::json::Path | P ) |
Definition at line 1091 of file Protocol.cpp.
References Text, and TypeParameter.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKindBitset & | Out, | ||
llvm::json::Path | P ) |
Definition at line 1125 of file Protocol.cpp.
References fromJSON().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
FileChangeType & | Out, | ||
llvm::json::Path | P ) |
Definition at line 655 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolID & | S, | ||
llvm::json::Path | P ) |
Definition at line 1750 of file Protocol.cpp.
References elog(), and clang::clangd::SymbolID::fromStr().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKind & | Out, | ||
llvm::json::Path | P ) |
Definition at line 256 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKindBitset & | Out, | ||
llvm::json::Path | P ) |
Definition at line 267 of file Protocol.cpp.
References fromJSON().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TraceLevel & | Out, | ||
llvm::json::Path | P ) |
Definition at line 238 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TypeHierarchyDirection & | Out, | ||
llvm::json::Path | P ) |
Definition at line 1390 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
URIForFile & | R, | ||
llvm::json::Path | P ) |
Definition at line 67 of file Protocol.cpp.
References clang::clangd::URIForFile::fromURI(), and clang::clangd::URI::parse().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Parameters, |
FuzzyFindRequest & | Request, | ||
llvm::json::Path | P ) |
Definition at line 30 of file Index.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, clang::clangd::FuzzyFindRequest::Limit, clang::clangd::FuzzyFindRequest::PreferredTypes, clang::clangd::FuzzyFindRequest::ProximityPaths, clang::clangd::FuzzyFindRequest::Query, clang::clangd::FuzzyFindRequest::RestrictForCodeCompletion, and clang::clangd::FuzzyFindRequest::Scopes.
Referenced by fromJSON(), fromJSON(), fromJSON(), fromJSON(), fromJSON(), fromJSON(), and fromJSON().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ASTParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1714 of file Protocol.cpp.
References clang::clangd::ASTParams::range, and clang::clangd::ASTParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyIncomingCallsParams & | C, | ||
llvm::json::Path | P ) |
Definition at line 1509 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyItem & | I, | ||
llvm::json::Path | P ) |
Definition at line 1496 of file Protocol.cpp.
References clang::clangd::CallHierarchyItem::data, clang::clangd::CallHierarchyItem::kind, clang::clangd::CallHierarchyItem::name, clang::clangd::CallHierarchyItem::range, clang::clangd::CallHierarchyItem::selectionRange, and clang::clangd::CallHierarchyItem::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CallHierarchyOutgoingCallsParams & | C, | ||
llvm::json::Path | P ) |
Definition at line 1519 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ChangeAnnotation & | R, | ||
llvm::json::Path | P ) |
Definition at line 205 of file Protocol.cpp.
References clang::clangd::ChangeAnnotation::description, clang::clangd::ChangeAnnotation::label, and clang::clangd::ChangeAnnotation::needsConfirmation.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClangdCompileCommand & | CDbUpdate, | ||
llvm::json::Path | P ) |
Definition at line 1362 of file Protocol.cpp.
References clang::clangd::ClangdCompileCommand::compilationCommand, and clang::clangd::ClangdCompileCommand::workingDirectory.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClientCapabilities & | R, | ||
llvm::json::Path | P ) |
Definition at line 362 of file Protocol.cpp.
References clang::clangd::ClientCapabilities::CancelsStaleRequests, clang::clangd::ClientCapabilities::ChangeAnnotation, clang::clangd::ClientCapabilities::CodeActionStructure, clang::clangd::ClientCapabilities::CompletionDocumentationFormat, clang::clangd::ClientCapabilities::CompletionFixes, clang::clangd::ClientCapabilities::CompletionItemKinds, clang::clangd::ClientCapabilities::CompletionLabelDetail, clang::clangd::ClientCapabilities::CompletionSnippets, clang::clangd::ClientCapabilities::DiagnosticCategory, clang::clangd::ClientCapabilities::DiagnosticFixes, clang::clangd::ClientCapabilities::DiagnosticRelatedInformation, clang::clangd::ClientCapabilities::DocumentChanges, elog(), fromJSON(), clang::clangd::ClientCapabilities::HasSignatureHelp, clang::clangd::ClientCapabilities::HierarchicalDocumentSymbol, clang::clangd::ClientCapabilities::HoverContentFormat, clang::clangd::ClientCapabilities::ImplicitProgressCreation, clang::clangd::ClientCapabilities::InactiveRegions, Info, clang::clangd::ClientCapabilities::LineFoldingOnly, clang::clangd::ClientCapabilities::OffsetsInSignatureHelp, Parameter, clang::clangd::ClientCapabilities::PositionEncodings, clang::clangd::ClientCapabilities::ReferenceContainer, References, clang::clangd::ClientCapabilities::RenamePrepareSupport, clang::clangd::ClientCapabilities::SemanticTokenRefreshSupport, clang::clangd::ClientCapabilities::SemanticTokens, clang::clangd::ClientCapabilities::SignatureHelpDocumentationFormat, clang::clangd::ClientCapabilities::TheiaSemanticHighlighting, clang::clangd::ClientCapabilities::WorkDoneProgress, and clang::clangd::ClientCapabilities::WorkspaceSymbolKinds.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionContext & | R, | ||
llvm::json::Path | P ) |
Definition at line 783 of file Protocol.cpp.
References clang::clangd::CodeActionContext::diagnostics, and clang::clangd::CodeActionContext::only.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 814 of file Protocol.cpp.
References clang::clangd::CodeActionParams::context, clang::clangd::CodeActionParams::range, and clang::clangd::CodeActionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionContext & | R, | ||
llvm::json::Path | P ) |
Definition at line 1020 of file Protocol.cpp.
References clang::clangd::CompletionContext::triggerCharacter, and clang::clangd::CompletionContext::triggerKind.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1031 of file Protocol.cpp.
References clang::clangd::CompletionParams::context, fromJSON(), clang::clangd::Context::get(), and clang::clangd::CompletionParams::limit.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ConfigurationSettings & | S, | ||
llvm::json::Path | P ) |
Definition at line 1369 of file Protocol.cpp.
References clang::clangd::ConfigurationSettings::compilationDatabaseChanges.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Diagnostic & | R, | ||
llvm::json::Path | P ) |
Definition at line 759 of file Protocol.cpp.
References clang::clangd::Diagnostic::category, clang::clangd::Diagnostic::code, clang::clangd::Diagnostic::data, clang::clangd::Diagnostic::message, clang::clangd::Diagnostic::range, clang::clangd::Diagnostic::severity, and clang::clangd::Diagnostic::source.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeConfigurationParams & | CCP, | ||
llvm::json::Path | P ) |
Definition at line 1356 of file Protocol.cpp.
References clang::clangd::DidChangeConfigurationParams::settings.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeTextDocumentParams & | R, | ||
llvm::json::Path | P ) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeWatchedFilesParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 673 of file Protocol.cpp.
References clang::clangd::DidChangeWatchedFilesParams::changes.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidCloseTextDocumentParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 634 of file Protocol.cpp.
References clang::clangd::DidCloseTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidOpenTextDocumentParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 628 of file Protocol.cpp.
References clang::clangd::DidOpenTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidSaveTextDocumentParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 640 of file Protocol.cpp.
References clang::clangd::DidSaveTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentFormattingParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 708 of file Protocol.cpp.
References clang::clangd::DocumentFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentLinkParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1664 of file Protocol.cpp.
References clang::clangd::DocumentLinkParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentOnTypeFormattingParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 701 of file Protocol.cpp.
References clang::clangd::DocumentOnTypeFormattingParams::ch, clang::clangd::DocumentOnTypeFormattingParams::position, and clang::clangd::DocumentOnTypeFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentRangeFormattingParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 686 of file Protocol.cpp.
References clang::clangd::DocumentRangeFormattingParams::range, and clang::clangd::DocumentRangeFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentRangesFormattingParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 693 of file Protocol.cpp.
References clang::clangd::DocumentRangesFormattingParams::ranges, and clang::clangd::DocumentRangesFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentSymbolParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 714 of file Protocol.cpp.
References clang::clangd::DocumentSymbolParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ExecuteCommandParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 829 of file Protocol.cpp.
References clang::clangd::ExecuteCommandParams::argument, and clang::clangd::ExecuteCommandParams::command.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FileEvent & | R, | ||
llvm::json::Path | P ) |
Definition at line 667 of file Protocol.cpp.
References clang::clangd::FileEvent::type, and clang::clangd::FileEvent::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FoldingRangeParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1677 of file Protocol.cpp.
References clang::clangd::FoldingRangeParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializationOptions & | Opts, | ||
llvm::json::Path | P ) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializeParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 564 of file Protocol.cpp.
References clang::clangd::InitializeParams::capabilities, clang::clangd::InitializeParams::initializationOptions, clang::clangd::InitializeParams::processId, clang::clangd::InitializeParams::rawCapabilities, clang::clangd::InitializeParams::rootPath, clang::clangd::InitializeParams::rootUri, and clang::clangd::InitializeParams::trace.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InlayHintsParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1529 of file Protocol.cpp.
References clang::clangd::InlayHintsParams::range, and clang::clangd::InlayHintsParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Position & | R, | ||
llvm::json::Path | P ) |
Definition at line 121 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Range & | R, | ||
llvm::json::Path | P ) |
Definition at line 138 of file Protocol.cpp.
References clang::clangd::Range::end, and clang::clangd::Range::start.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceContext & | R, | ||
llvm::json::Path | P ) |
Definition at line 1464 of file Protocol.cpp.
References clang::clangd::ReferenceContext::includeDeclaration.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1470 of file Protocol.cpp.
References clang::clangd::ReferenceParams::context, and fromJSON().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
RenameParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1246 of file Protocol.cpp.
References clang::clangd::RenameParams::newName, clang::clangd::RenameParams::position, and clang::clangd::RenameParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ResolveTypeHierarchyItemParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1456 of file Protocol.cpp.
References clang::clangd::ResolveTypeHierarchyItemParams::direction, clang::clangd::ResolveTypeHierarchyItemParams::item, and clang::clangd::ResolveTypeHierarchyItemParams::resolve.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SelectionRangeParams & | S, | ||
llvm::json::Path | P ) |
Definition at line 1649 of file Protocol.cpp.
References clang::clangd::SelectionRangeParams::positions, and clang::clangd::SelectionRangeParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensDeltaParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1333 of file Protocol.cpp.
References clang::clangd::SemanticTokensDeltaParams::previousResultId, and clang::clangd::SemanticTokensDeltaParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
SemanticTokensParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1327 of file Protocol.cpp.
References clang::clangd::SemanticTokensParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentContentChangeEvent & | R, | ||
llvm::json::Path | P ) |
Definition at line 679 of file Protocol.cpp.
References clang::clangd::TextDocumentContentChangeEvent::range, clang::clangd::TextDocumentContentChangeEvent::rangeLength, and clang::clangd::TextDocumentContentChangeEvent::text.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentEdit & | R, | ||
llvm::json::Path | P ) |
Definition at line 221 of file Protocol.cpp.
References clang::clangd::TextDocumentEdit::edits, and clang::clangd::TextDocumentEdit::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentIdentifier & | R, | ||
llvm::json::Path | P ) |
Definition at line 102 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentItem & | R, | ||
llvm::json::Path | P ) |
Definition at line 181 of file Protocol.cpp.
References clang::clangd::TextDocumentItem::languageId, clang::clangd::TextDocumentItem::text, clang::clangd::TextDocumentItem::uri, and clang::clangd::TextDocumentItem::version.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentPositionParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 1013 of file Protocol.cpp.
References clang::clangd::TextDocumentPositionParams::position, and clang::clangd::TextDocumentPositionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextEdit & | R, | ||
llvm::json::Path | P ) |
Definition at line 188 of file Protocol.cpp.
References clang::clangd::TextEdit::annotationId, clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TweakArgs & | A, | ||
llvm::json::Path | P ) |
Definition at line 990 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyItem & | I, | ||
llvm::json::Path | P ) |
Definition at line 1441 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::children, clang::clangd::TypeHierarchyItem::data, clang::clangd::TypeHierarchyItem::deprecated, clang::clangd::TypeHierarchyItem::detail, clang::clangd::TypeHierarchyItem::kind, clang::clangd::TypeHierarchyItem::name, clang::clangd::TypeHierarchyItem::parents, clang::clangd::TypeHierarchyItem::range, clang::clangd::TypeHierarchyItem::selectionRange, and clang::clangd::TypeHierarchyItem::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyItem::ResolveParams & | RP, | ||
llvm::json::Path | P ) |
Definition at line 1422 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::ResolveParams::parents, and clang::clangd::TypeHierarchyItem::ResolveParams::symbolID.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TypeHierarchyPrepareParams & | R, | ||
llvm::json::Path | P ) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
VersionedTextDocumentIdentifier & | R, | ||
llvm::json::Path | P ) |
Definition at line 114 of file Protocol.cpp.
References fromJSON(), and clang::clangd::VersionedTextDocumentIdentifier::version.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceEdit & | R, | ||
llvm::json::Path | P ) |
Definition at line 821 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changeAnnotations, clang::clangd::WorkspaceEdit::changes, and clang::clangd::WorkspaceEdit::documentChanges.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceSymbolParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 918 of file Protocol.cpp.
References clang::clangd::WorkspaceSymbolParams::limit, and clang::clangd::WorkspaceSymbolParams::query.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Response, |
ApplyWorkspaceEditResponse & | R, | ||
llvm::json::Path | P ) |
Definition at line 1006 of file Protocol.cpp.
References clang::clangd::ApplyWorkspaceEditResponse::applied, and clang::clangd::ApplyWorkspaceEditResponse::failureReason.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
MarkupKind & | K, | ||
llvm::json::Path | P ) |
Definition at line 1051 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | V, |
OffsetEncoding & | OE, | ||
llvm::json::Path | P ) |
Definition at line 1633 of file Protocol.cpp.
References UnsupportedEncoding, UTF16, UTF32, and UTF8.
bool clang::clangd::fromJSON | ( | const TypeHierarchyItem::ResolveParams & | ) |
Symbol clang::clangd::func | ( | llvm::StringRef | Name | ) |
Definition at line 62 of file TestIndex.cpp.
References sym().
SymbolSlab clang::clangd::generateNumSymbols | ( | int | Begin, |
int | End ) |
Definition at line 128 of file TestIndex.cpp.
References generateSymbols().
SymbolSlab clang::clangd::generateSymbols | ( | std::vector< std::string > | QualifiedNames | ) |
Definition at line 121 of file TestIndex.cpp.
References clang::clangd::SymbolSlab::Builder::insert(), and symbol().
Referenced by generateNumSymbols().
clang::LangOptions clang::clangd::genericLangOpts | ( | clang::Language | Lang, |
clang::LangStandard::Kind | Standard ) |
A generic lang options suitable for lexing/parsing a langage.
Definition at line 96 of file Token.cpp.
References Standard.
Referenced by getFoldingRanges().
std::vector< const Attr * > clang::clangd::getAttributes | ( | const DynTypedNode & | N | ) |
std::optional< llvm::StringRef > clang::clangd::getBacktickQuoteRange | ( | llvm::StringRef | Line, |
unsigned | Offset ) |
Definition at line 1734 of file Hover.cpp.
Referenced by parseDocumentationParagraph().
std::optional< std::string > clang::clangd::getCanonicalPath | ( | const FileEntryRef | F, |
FileManager & | FileMgr ) |
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 520 of file SourceCode.cpp.
References elog().
Referenced by declToHierarchyItem(), clang::clangd::Tweak::Effect::fileEdit(), clang::clangd::StoreDiags::HandleDiagnostic(), clang::clangd::IncludeStructure::RecordHeaders::InclusionDirective(), and clang::clangd::SymbolCollector::HeaderFileURICache::toURI().
TemplateTypeParmTypeLoc clang::clangd::getContainedAutoParamType | ( | TypeLoc | TL | ) |
Definition at line 621 of file AST.cpp.
References getContainedAutoParamType().
Referenced by getContainedAutoParamType().
std::optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | PathRef | OriginalFile, |
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS ) |
Given a header file, returns the best matching source file, and vice visa.
It only uses the filename heuristics to do the inference.
Definition at line 21 of file HeaderSourceSwitch.cpp.
Referenced by clang::clangd::ClangdServer::switchSourceHeader().
std::optional< Path > clang::clangd::getCorrespondingHeaderOrSource | ( | PathRef | OriginalFile, |
ParsedAST & | AST, | ||
const SymbolIndex * | Index ) |
Given a header file, returns the best matching source file, and vice visa.
The heuristics incorporate with the AST and the index (if provided).
Definition at line 71 of file HeaderSourceSwitch.cpp.
References AST, clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::Definition, elog(), clang::clangd::SymbolLocation::FileURI, getIndexableLocalDecls(), getSymbolID(), clang::clangd::LookupRequest::IDs, isHeaderFile(), clang::clangd::SymbolIndex::lookup(), pathEqual(), and clang::clangd::URI::resolve().
const ObjCImplDecl * clang::clangd::getCorrespondingObjCImpl | ( | const ObjCContainerDecl * | D | ) |
Return the corresponding implementation/definition for the given ObjC container if it has one, otherwise, return nullptr.
Objective-C classes can have three types of declarations:
Objective-C categories are extensions on classes:
With one special case, a class extension, which is normally used to keep some declarations internal to a file without exposing them in a header.
For Objective-C protocols, e.g. "@protocol MyProtocol ... @end" this will return nullptr as protocols don't have an implementation.
std::string clang::clangd::getDeclComment | ( | const ASTContext & | Ctx, |
const NamedDecl & | Decl ) |
Similar to getDocComment, but returns the comment for a NamedDecl.
Definition at line 100 of file CodeCompletionStrings.cpp.
References clang::clangd::Config::CommentFormat, clang::clangd::Config::current(), clang::clangd::Config::Documentation, clang::clangd::Config::Doxygen, clang::clangd::SymbolDocCommentVisitor::parameterDocToString(), and clang::clangd::SymbolDocCommentVisitor::templateTypeParmDocToString().
Referenced by getDocComment().
std::optional< QualType > clang::clangd::getDeducedType | ( | ASTContext & | , |
SourceLocation | Loc ) |
Retrieves the deduced type at a given location (auto, decltype).
It will return the underlying type. If the type is an undeduced auto, returns the type itself.
Definition at line 611 of file AST.cpp.
Referenced by getHover(), locateSymbolAt(), and typeForNode().
unsigned clang::clangd::getDefaultAsyncThreadsCount | ( | ) |
Returns a number of a default async threads to use for TUScheduler.
Returned value is always >= 1 (i.e. will not cause requests to be processed synchronously).
Definition at line 1614 of file TUScheduler.cpp.
std::optional< std::string > clang::clangd::getDiagnosticDocURI | ( | Diag::DiagSource | Source, |
unsigned | ID, | ||
llvm::StringRef | Name ) |
Returns a URI providing more information about a particular diagnostic.
Definition at line 935 of file Diagnostics.cpp.
References clang::clangd::Diag::Clang, clang::clangd::Diag::Clangd, clang::clangd::Diag::ClangdConfig, clang::clangd::Diag::ClangTidy, Module, and clang::clangd::Diag::Unknown.
Referenced by toLSPDiags().
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 88 of file CodeCompletionStrings.cpp.
References getDeclComment().
std::vector< DocumentLink > clang::clangd::getDocumentLinks | ( | ParsedAST & | AST | ) |
Get all document links.
Definition at line 855 of file XRefs.cpp.
References AST, clang::clangd::URIForFile::canonicalize(), and halfOpenToRange().
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 664 of file FindSymbols.cpp.
References AST, and getDocumentSymbols().
Referenced by clang::clangd::ClangdServer::documentSymbols(), and getDocumentSymbols().
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 1167 of file SourceCode.cpp.
References clang::clangd::EligibleRegion::EligiblePoints, clang::clangd::EligibleRegion::EnclosingNamespace, and offsetToPosition().
|
static |
Definition at line 378 of file SourceCode.cpp.
References rangeInCommonFile(), and toTokenRange().
Referenced by getTokenFileRange().
llvm::Expected< std::vector< FoldingRange > > clang::clangd::getFoldingRanges | ( | const std::string & | Code, |
bool | LineFoldingOnly ) |
Returns a list of ranges whose contents might be collapsible in an editor.
This version uses the pseudoparser which does not require the AST.
Definition at line 182 of file SemanticSelection.cpp.
References clang::clangd::Position::character, chooseConditionalBranches(), clang::clangd::FoldingRange::COMMENT_KIND, cook(), clang::clangd::FoldingRange::endCharacter, clang::clangd::FoldingRange::endLine, genericLangOpts(), clang::clangd::FoldingRange::kind, lex(), clang::clangd::Position::line, offsetToPosition(), pairBrackets(), pairDirectiveRanges(), clang::clangd::FoldingRange::REGION_KIND, clang::clangd::FoldingRange::startCharacter, and clang::clangd::FoldingRange::startLine.
llvm::Expected< std::vector< FoldingRange > > clang::clangd::getFoldingRanges | ( | ParsedAST & | AST | ) |
Returns a list of ranges whose contents might be collapsible in an editor.
This should include large scopes, preprocessor blocks etc.
Definition at line 170 of file SemanticSelection.cpp.
References AST.
Referenced by clang::clangd::ClangdServer::foldingRanges().
format::FormatStyle clang::clangd::getFormatStyleForFile | ( | llvm::StringRef | File, |
llvm::StringRef | Content, | ||
const ThreadsafeFS & | TFS, | ||
bool | FormatFile ) |
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()! FormatFile
indicates whether the returned FormatStyle is used to format the entire main file (or a range selected by the user which can be arbitrarily long).
Definition at line 583 of file SourceCode.cpp.
References File, log(), and clang::clangd::ThreadsafeFS::view().
Referenced by clang::clangd::ClangdServer::applyTweak(), clang::clangd::ParsedAST::build(), clang::clangd::ClangdServer::findHover(), clang::clangd::ClangdServer::formatFile(), clang::clangd::ClangdServer::formatOnType(), and clang::clangd::ClangdServer::rename().
std::optional< HoverInfo > clang::clangd::getHover | ( | ParsedAST & | AST, |
Position | Pos, | ||
const format::FormatStyle & | Style, | ||
const SymbolIndex * | Index ) |
Get the hover information when hovering at Pos
.
Definition at line 1252 of file Hover.cpp.
References Alias, AST, clang::clangd::URIForFile::canonicalize(), clang::clangd::SelectionTree::commonAncestor(), clang::clangd::trace::Metric::Counter, clang::clangd::SelectionTree::createRight(), Deduced, clang::clangd::HoverInfo::Definition, clang::clangd::HoverInfo::DefinitionLanguage, explicitReferenceTargets(), clang::clangd::URIForFile::file(), getDeducedType(), halfOpenToRange(), clang::clangd::HoverInfo::Kind, clang::clangd::Position::line, locateMacroAt(), clang::clangd::HoverInfo::Name, clang::clangd::trace::Metric::record(), and sourceLocationInMainFile().
Referenced by clang::clangd::ClangdServer::findHover().
Definition at line 1534 of file SemanticHighlighting.cpp.
References AST, clang::clangd::Position::character, elog(), clang::clangd::Range::end, clang::clangd::Position::line, and clang::clangd::Range::start.
std::vector< const Decl * > clang::clangd::getIndexableLocalDecls | ( | ParsedAST & | AST | ) |
Returns all indexable decls that are present in the main file of the AST.
Exposed for unittests.
Definition at line 126 of file HeaderSourceSwitch.cpp.
References AST, and clang::clangd::SymbolCollector::shouldCollectSymbol().
Referenced by getCorrespondingHeaderOrSource().
|
static |
Definition at line 310 of file SourceCode.cpp.
References getTokenLengthAtLoc().
Referenced by toTokenRange().
|
static |
Definition at line 302 of file SourceCode.cpp.
References getTokenLengthAtLoc().
Referenced by unionTokenRange().
std::optional< std::vector< SymbolRange > > clang::clangd::getMappedRanges | ( | ArrayRef< Range > | Indexed, |
ArrayRef< SymbolRange > | Lexed ) |
Calculates the lexed occurrences that the given indexed occurrences map to.
Returns std::nullopt if we don't find a mapping.
Exposed for testing only.
REQUIRED: Indexed and Lexed are sorted.
Definition at line 1297 of file Rename.cpp.
References renameRangeAdjustmentCost(), SPAN_ATTACH, and vlog().
Referenced by adjustRenameRanges().
|
static |
Definition at line 310 of file AST.cpp.
Referenced by printObjCContainer().
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 2475 of file XRefs.cpp.
References AST, findExplicitReferences(), and getNonLocalDeclRefs().
Referenced by getNonLocalDeclRefs().
NamedDecl * clang::clangd::getOnlyInstantiation | ( | NamedDecl * | TemplatedDecl | ) |
Definition at line 648 of file AST.cpp.
References getOnlyInstantiationImpl().
|
static |
Definition at line 636 of file AST.cpp.
Referenced by getOnlyInstantiation().
|
static |
Definition at line 789 of file Preamble.cpp.
References clang::clangd::PreamblePatch::HeaderName.
Referenced by clang::clangd::PreamblePatch::getPatchEntry().
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 702 of file AST.cpp.
References getQualification().
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 684 of file AST.cpp.
References getQualification().
Referenced by getQualification(), and getQualification().
std::string clang::clangd::getQualifiedName | ( | const Symbol & | Sym | ) |
Definition at line 135 of file TestIndex.cpp.
References clang::clangd::Symbol::Name, clang::clangd::Symbol::Scope, and clang::clangd::Symbol::TemplateSpecializationArgs.
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 227 of file AST.cpp.
Referenced by printName().
llvm::SmallVector< SymbolInclude, 1 > clang::clangd::getRankedIncludes | ( | const Symbol & | Sym | ) |
Definition at line 163 of file Headers.cpp.
References clang::clangd::Symbol::IncludeHeaderWithReferences::IncludeHeader, clang::clangd::Symbol::IncludeHeaders, and clang::clangd::Symbol::IncludeHeaderWithReferences::References.
RefSlab clang::clangd::getRefs | ( | const SymbolIndex & | Index, |
SymbolID | ID ) |
Definition at line 139 of file SyncAPI.cpp.
References clang::clangd::RefsRequest::IDs, clang::clangd::RefSlab::Builder::insert(), and clang::clangd::SymbolIndex::refs().
std::string clang::clangd::getReturnType | ( | const CodeCompletionString & | CCS | ) |
Gets detail to be used as the detail field in an LSP completion item.
This is usually the return type of a function.
Definition at line 356 of file CodeCompletionStrings.cpp.
std::vector< HighlightingToken > clang::clangd::getSemanticHighlightings | ( | ParsedAST & | AST, |
bool | IncludeInactiveRegionTokens ) |
Definition at line 1136 of file SemanticHighlighting.cpp.
References Abstract, AST, ConstructorOrDestructor, Declaration, DefaultLibrary, Definition, DependentName, Deprecated, findExplicitReferences(), GlobalScope, InactiveCode, clang::clangd::ReferenceLoc::IsDecl, Macro, clang::clangd::ReferenceLoc::NameLoc, Readonly, Static, clang::clangd::ReferenceLoc::Targets, and Virtual.
Referenced by clang::clangd::ClangdServer::semanticHighlights().
llvm::Expected< SelectionRange > clang::clangd::getSemanticRanges | ( | ParsedAST & | AST, |
Position | Pos ) |
Returns the list of all interesting ranges around the Position Pos
.
The interesting ranges corresponds to the AST nodes in the SelectionTree containing Pos
. If pos is not in any interesting range, return [Pos, Pos).
Definition at line 112 of file SemanticSelection.cpp.
References AST, clang::clangd::SelectionTree::commonAncestor(), clang::clangd::SelectionTree::createRight(), Empty, clang::clangd::Range::end, Head, clang::clangd::SelectionTree::Node::Parent, positionToOffset(), sourceLocToPosition(), clang::clangd::Range::start, Tail, and toHalfOpenFileRange().
Referenced by clang::clangd::ClangdServer::semanticRanges().
int clang::clangd::getSeverity | ( | DiagnosticsEngine::Level | L | ) |
Convert from clang diagnostic level to LSP severity.
Definition at line 555 of file Diagnostics.cpp.
Referenced by toLSPDiags().
void clang::clangd::getSignature | ( | const CodeCompletionString & | CCS, |
std::string * | Signature, | ||
std::string * | Snippet, | ||
CodeCompletionResult::ResultKind | ResultKind, | ||
CXCursorKind | CursorKind, | ||
bool | IncludeFunctionArguments = true, | ||
std::string * | RequiredQualifiers = nullptr ) |
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.
If IncludeFunctionArguments
is disabled, the Snippet
will only contain function name and template arguments, if any.
When ResultKind
is RK_Pattern, the last placeholder will be $0, indicating the cursor should stay there. Note that for certain CursorKind
like CXCursor_Constructor
, $0 won't be emitted in order to avoid overlapping normal parameters.
Definition at line 163 of file CodeCompletionStrings.cpp.
References Snippet.
Referenced by clang::clangd::SymbolCollector::handleMacroOccurrence().
std::optional< std::string > clang::clangd::getSpelledSpecifier | ( | const CXXScopeSpec & | SS, |
const SourceManager & | SM ) |
Definition at line 383 of file clangd/IncludeFixer.cpp.
References toSourceCode().
Referenced by extractUnresolvedNameCheaply().
llvm::StringRef clang::clangd::getStdHeader | ( | const Symbol * | S, |
const LangOptions & | LangOpts ) |
Definition at line 893 of file SymbolCollector.cpp.
References clang::clangd::Symbol::Name, clang::clangd::Symbol::Scope, and clang::clangd::Symbol::Signature.
Referenced by clang::clangd::SymbolCollector::finish().
llvm::StringRef clang::clangd::getStdlibUmbrellaHeader | ( | const LangOptions & | LO | ) |
Definition at line 98 of file StdLib.cpp.
Referenced by indexStandardLibrary().
SymbolID clang::clangd::getSymbolID | ( | const Decl * | D | ) |
Gets the symbol ID for a declaration. Returned SymbolID might be null.
Definition at line 352 of file AST.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::computeASTSignals(), declToCallHierarchyItem(), declToTypeHierarchyItem(), findImplementations(), findReferences(), getCorrespondingHeaderOrSource(), and getTypeHierarchy().
SymbolID clang::clangd::getSymbolID | ( | const llvm::StringRef | MacroName, |
const MacroInfo * | MI, | ||
const SourceManager & | SM ) |
Gets the symbol ID for a macro.
Returned SymbolID might be null. Currently, this is an encoded USR of the macro, which incorporates macro locations (e.g. file name, offset in file). FIXME: the USR semantics might not be stable enough as the ID for index macro (e.g. a change in definition offset can result in a different USR). We could change these semantics in the future by reimplementing this funcure (e.g. avoid USR for macros).
std::vector< SymbolDetails > clang::clangd::getSymbolInfo | ( | ParsedAST & | AST, |
Position | Pos ) |
Get info about symbols at Pos
.
Definition at line 1666 of file XRefs.cpp.
References Alias, AST, clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::declarationRange, clang::clangd::SymbolDetails::definitionRange, getSymbolInfo(), clang::clangd::SymbolDetails::ID, locateMacroAt(), clang::clangd::SymbolDetails::name, nameLocation(), printQualifiedName(), sourceLocationInMainFile(), splitQualifiedName(), TemplatePattern, Underlying, and clang::clangd::SymbolDetails::USR.
Referenced by getSymbolInfo(), and clang::clangd::ClangdServer::symbolInfo().
SystemIncludeExtractorFn clang::clangd::getSystemIncludeExtractor | ( | llvm::ArrayRef< std::string > | QueryDriverGlobs | ) |
Definition at line 543 of file SystemIncludeExtractor.cpp.
Referenced by main().
tidy::ClangTidyOptions clang::clangd::getTidyOptionsForFile | ( | TidyProviderRef | Provider, |
llvm::StringRef | Filename ) |
Definition at line 286 of file TidyProvider.cpp.
References clang::tidy::ClangTidyOptions::getDefaults().
Referenced by clang::clangd::ParsedAST::build().
|
static |
Definition at line 1195 of file ClangdLSPServer.cpp.
References clang::clangd::Range::contains(), clang::clangd::LocatedSymbol::Definition, clang::clangd::URIForFile::file(), getToggle(), clang::clangd::TextDocumentPositionParams::position, clang::clangd::LocatedSymbol::PreferredDeclaration, clang::clangd::Location::range, clang::clangd::TextDocumentPositionParams::textDocument, clang::clangd::Location::uri, and clang::clangd::TextDocumentIdentifier::uri.
Referenced by getToggle().
|
static |
Definition at line 395 of file SourceCode.cpp.
References getExpansionTokenRangeInSameFile(), and unionTokenRange().
Referenced by toHalfOpenFileRange().
|
static |
Definition at line 286 of file SourceCode.cpp.
Referenced by getLocForTokenBegin(), getLocForTokenEnd(), and toHalfOpenFileRange().
std::vector< 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 2220 of file XRefs.cpp.
References AST, Both, Children, declToTypeHierarchyItem(), fillSubTypes(), fillSuperTypes(), findRecordTypeAt(), getSymbolID(), and getTypeHierarchy().
Referenced by getTypeHierarchy(), and 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 85 of file FindSymbols.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, dlog, evaluateSymbolAndRelevance(), clang::clangd::SymbolIndex::fuzzyFind(), clang::clangd::SymbolRelevanceSignals::Generic, indexSymbolKindToSymbolKind(), Info, clang::clangd::FuzzyFindRequest::Limit, clang::clangd::FuzzyMatcher::match(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::Symbol::Name, clang::clangd::SymbolRelevanceSignals::Name, clang::clangd::TopN< T, Compare >::push(), clang::clangd::FuzzyFindRequest::Query, clang::clangd::Symbol::Scope, clang::clangd::FuzzyFindRequest::Scopes, splitQualifiedName(), clang::clangd::Symbol::SymInfo, and clang::clangd::Symbol::TemplateSpecializationArgs.
CompletionPrefix clang::clangd::guessCompletionPrefix | ( | llvm::StringRef | Content, |
unsigned | Offset ) |
Definition at line 2184 of file CodeComplete.cpp.
References clang::clangd::CompletionPrefix::Name, and clang::clangd::CompletionPrefix::Qualifier.
Range clang::clangd::halfOpenToRange | ( | const SourceManager & | SM, |
CharSourceRange | R ) |
Definition at line 472 of file SourceCode.cpp.
References sourceLocToPosition().
Referenced by collectIdentifierRanges(), getDocumentLinks(), getHover(), clang::clangd::SymbolCollector::handleMacros(), rename(), clang::clangd::MacroOccurrence::toRange(), and toTextEdit().
|
static |
Definition at line 34 of file Quality.cpp.
References isInsideMainFile().
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
auto clang::clangd::hasFlag | ( | llvm::StringRef | Flag | ) |
Definition at line 515 of file GlobalCompilationDatabaseTests.cpp.
References hasFlag().
Referenced by hasFlag(), MATCHER_P2(), and TEST_F().
|
inline |
Definition at line 66 of file SymbolID.h.
References clang::clangd::SymbolID::raw(), and clang::clangd::SymbolID::RawSize.
bool clang::clangd::hasReservedName | ( | const Decl & | D | ) |
Returns true if this is a NamedDecl with a reserved name.
Definition at line 442 of file AST.cpp.
References isReservedName().
Referenced by hasReservedScope(), and clang::clangd::SymbolCollector::shouldCollectSymbol().
bool clang::clangd::hasReservedScope | ( | const DeclContext & | ) |
Returns true if this scope would be written with a reserved name.
This does not include unwritten scope elements like __1 in std::__1::vector.
Definition at line 449 of file AST.cpp.
References hasReservedName().
Referenced by clang::clangd::SymbolCollector::shouldCollectSymbol().
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 721 of file AST.cpp.
References hasUnstableLinkage().
Referenced by clang::clangd::SymbolRelevanceSignals::computeASTSignals(), computeScope(), and hasUnstableLinkage().
|
static |
Definition at line 43 of file Quality.cpp.
References isInsideMainFile().
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
std::optional< HighlightingKind > clang::clangd::highlightingKindFromString | ( | llvm::StringRef | Name | ) |
Definition at line 1265 of file SemanticHighlighting.cpp.
References Bracket, Class, Concept, Enum, EnumConstant, Field, Function, InactiveCode, Interface, LocalVariable, Macro, Method, Modifier, Namespace, Operator, Parameter, Primitive, StaticField, StaticMethod, TemplateParameter, Type, Typedef, Unknown, and Variable.
std::optional< HighlightingModifier > clang::clangd::highlightingModifierFromString | ( | llvm::StringRef | Name | ) |
Definition at line 1309 of file SemanticHighlighting.cpp.
References Abstract, ClassScope, ConstructorOrDestructor, Declaration, Deduced, DefaultLibrary, Definition, DependentName, Deprecated, FileScope, FunctionScope, GlobalScope, Readonly, Static, UsedAsMutablePointer, UsedAsMutableReference, UserDefined, and Virtual.
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 264 of file SourceCode.cpp.
Referenced by rangeInCommonFile().
std::vector< CallHierarchyIncomingCall > clang::clangd::incomingCalls | ( | const CallHierarchyItem & | Item, |
const SymbolIndex * | Index ) |
Definition at line 2335 of file XRefs.cpp.
References clang::clangd::Ref::Container, clang::clangd::CallHierarchyItem::data, elog(), clang::clangd::URIForFile::file(), clang::clangd::RefsRequest::Filter, clang::clangd::SymbolID::fromStr(), clang::clangd::Symbol::ID, clang::clangd::LookupRequest::IDs, clang::clangd::RefsRequest::IDs, incomingCalls(), indexToLSPLocation(), clang::clangd::Ref::Location, clang::clangd::SymbolIndex::lookup(), clang::clangd::Location::range, Reference, clang::clangd::SymbolIndex::refs(), symbolToCallHierarchyItem(), clang::clangd::CallHierarchyItem::uri, clang::clangd::Location::uri, clang::clangd::URIForFile::uri(), and clang::clangd::RefsRequest::WantContainer.
Referenced by clang::clangd::ClangdServer::incomingCalls(), and incomingCalls().
|
static |
Definition at line 1574 of file ClangdLSPServer.cpp.
References increment().
Referenced by increment(), and updateVersion().
|
static |
Definition at line 39 of file DraftStore.cpp.
SlabTuple clang::clangd::indexHeaderSymbols | ( | llvm::StringRef | Version, |
ASTContext & | AST, | ||
Preprocessor & | PP, | ||
const include_cleaner::PragmaIncludes & | PI, | ||
SymbolOrigin | Origin ) |
Index declarations from AST
and macros from PP
that are declared in included headers.
Definition at line 231 of file FileIndex.cpp.
References AST, and indexHeaderSymbols().
Referenced by clang::clangd::TestTU::headerSymbols(), indexHeaderSymbols(), indexStandardLibrary(), and clang::clangd::FileIndex::updatePreamble().
Retrieves symbols and refs of local top level decls in AST
(i.e.
AST.getLocalTopLevelDecls()). Exposed to assist in unit tests.
Definition at line 223 of file FileIndex.cpp.
References AST, indexMainDecls(), and Open.
Referenced by clang::clangd::TestTU::headerRefs(), indexMainDecls(), and clang::clangd::FileIndex::updateMain().
SymbolSlab clang::clangd::indexStandardLibrary | ( | llvm::StringRef | HeaderSources, |
std::unique_ptr< CompilerInvocation > | CI, | ||
const StdLibLocation & | Loc, | ||
const ThreadsafeFS & | TFS ) |
Definition at line 200 of file StdLib.cpp.
References elog(), indexHeaderSymbols(), log(), prepareCompilerInstance(), SPAN_ATTACH, StdLib, Symbols, and clang::clangd::ThreadsafeFS::view().
Referenced by indexStandardLibrary().
SymbolSlab clang::clangd::indexStandardLibrary | ( | std::unique_ptr< CompilerInvocation > | Invocation, |
const StdLibLocation & | Loc, | ||
const ThreadsafeFS & | TFS ) |
Definition at line 265 of file StdLib.cpp.
References getStdlibUmbrellaHeader(), and indexStandardLibrary().
SymbolKind clang::clangd::indexSymbolKindToSymbolKind | ( | index::SymbolKind | Kind | ) |
Definition at line 298 of file Protocol.cpp.
Referenced by declToHierarchyItem(), getWorkspaceSymbols(), and symbolToHierarchyItem().
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 60 of file FindSymbols.cpp.
References clang::clangd::URIForFile::canonicalize(), clang::clangd::Position::character, clang::clangd::SymbolLocation::End, error(), clang::clangd::SymbolLocation::FileURI, clang::clangd::Position::line, clang::clangd::Location::range, clang::clangd::URI::resolve(), clang::clangd::SymbolLocation::Start, and clang::clangd::Location::uri.
Referenced by incomingCalls(), locateSymbolTextually(), outgoingCalls(), and symbolToLocation().
|
static |
Definition at line 1106 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and log().
Referenced by applyChange().
void clang::clangd::initializeModuleCache | ( | CompilerInvocation & | CI | ) |
Definition at line 82 of file TestTU.cpp.
Referenced by clang::clangd::TestTU::build(), and clang::clangd::TestTU::preamble().
std::vector< InlayHint > clang::clangd::inlayHints | ( | ParsedAST & | AST, |
std::optional< Range > | RestrictRange, | ||
InlayHintOptions | HintOptions = {} ) |
Compute and return inlay hints for a file.
If RestrictRange is set, return only hints whose location is in that range.
Definition at line 1156 of file InlayHints.cpp.
References AST, and clang::clangd::Config::current().
Referenced by clang::clangd::ClangdServer::inlayHints().
llvm::Expected< tooling::Replacement > clang::clangd::insertDecl | ( | llvm::StringRef | Code, |
const CXXRecordDecl & | InClass, | ||
std::vector< Anchor > | Anchors, | ||
AccessSpecifier | Protection ) |
Definition at line 136 of file InsertionPoint.cpp.
References clang::clangd::Anchor::Below, error(), and insertionPoint().
llvm::Expected< tooling::Replacement > clang::clangd::insertDecl | ( | llvm::StringRef | Code, |
const DeclContext & | DC, | ||
llvm::ArrayRef< Anchor > | Anchors ) |
Definition at line 113 of file InsertionPoint.cpp.
References error(), and insertionPoint().
SourceLocation clang::clangd::insertionPoint | ( | const CXXRecordDecl & | InClass, |
std::vector< Anchor > | Anchors, | ||
AccessSpecifier | Protection ) |
Definition at line 126 of file InsertionPoint.cpp.
References insertionPoint().
SourceLocation clang::clangd::insertionPoint | ( | const DeclContext & | DC, |
llvm::ArrayRef< Anchor > | Anchors ) |
Definition at line 98 of file InsertionPoint.cpp.
References clang::clangd::Anchor::Above, and dlog.
Referenced by insertDecl(), insertDecl(), and insertionPoint().
|
static |
Definition at line 223 of file AST.cpp.
Referenced by printName().
|
static |
Definition at line 73 of file FuzzyMatch.cpp.
References AwfulScore.
Referenced by clang::clangd::FuzzyMatcher::dumpLast(), and 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 clang::clangd::Context::get(), and StateKey.
Referenced by clang::clangd::ClangdServer::codeComplete().
bool clang::clangd::isDeeplyNested | ( | const Decl * | D, |
unsigned | MaxDepth = 10 ) |
Checks whether D
is more than MaxDepth
away from translation unit scope.
This is useful for limiting traversals to keep operation latencies reasonable.
Definition at line 728 of file AST.cpp.
References isDeeplyNested().
Referenced by isDeeplyNested().
bool clang::clangd::isDiagnosticSuppressed | ( | const clang::Diagnostic & | Diag, |
const llvm::StringSet<> & | Suppress, | ||
const LangOptions & | LangOpts ) |
Determine whether a (non-clang-tidy) diagnostic is suppressed by config.
Definition at line 907 of file Diagnostics.cpp.
References normalizeSuppressedCode(), and Warning.
Referenced by clang::clangd::ParsedAST::build(), and buildPreamble().
bool clang::clangd::isExpandedFromParameterPack | ( | const ParmVarDecl * | D | ) |
Checks whether D is instantiated from a function parameter pack whose type is a bare type parameter pack (e.g.
Args...), or a reference to one (e.g. Args&... or Args&&...).
Definition at line 1025 of file AST.cpp.
References isExpandedFromParameterPack().
Referenced by isExpandedFromParameterPack().
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 186 of file AST.cpp.
Referenced by isIndexedForCodeCompletion().
std::optional< bool > clang::clangd::isFastTidyCheck | ( | llvm::StringRef | Check | ) |
Returns if Check
is known-fast, known-slow, or its speed is unknown.
By default, only fast checks will run in clangd.
Definition at line 322 of file TidyProvider.cpp.
bool clang::clangd::isHeaderFile | ( | llvm::StringRef | FileName, |
std::optional< LangOptions > | LangOpts ) |
Infers whether this is a header from the FileName and LangOpts (if presents).
Definition at line 1220 of file SourceCode.cpp.
Referenced by clang::clangd::BackgroundIndex::boostRelated(), getCorrespondingHeaderOrSource(), clang::clangd::SymbolCollector::handleDeclOccurrence(), clang::clangd::SymbolCollector::handleMacroOccurrence(), and preferredIncludeDirective().
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 190 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 2454 of file CodeComplete.cpp.
Referenced by allowImplicitCompletion().
bool clang::clangd::isIndexedForCodeCompletion | ( | const NamedDecl & | ND, |
ASTContext & | ASTCtx ) |
Definition at line 2330 of file CodeComplete.cpp.
References isExplicitTemplateSpecialization().
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 423 of file SourceCode.cpp.
Referenced by clang::clangd::ParsedAST::build(), clang::clangd::IncludeFixer::UnresolvedNameRecorder::CorrectTypo(), clang::clangd::CollectMainFileMacros::FileChanged(), clang::clangd::StoreDiags::HandleDiagnostic(), hasDeclInMainFile(), hasUsingDeclInMainFile(), clang::clangd::IncludeStructure::RecordHeaders::InclusionDirective(), and clang::clangd::CollectPragmaMarks::PragmaMark().
|
static |
Definition at line 167 of file Quality.cpp.
|
static |
Definition at line 157 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge(), and clang::clangd::SymbolRelevanceSignals::merge().
bool clang::clangd::isKeyword | ( | llvm::StringRef | NewName, |
const LangOptions & | LangOpts ) |
Return true if the TokenName
is in the list of reversed keywords of the language.
Definition at line 659 of file SourceCode.cpp.
|
static |
Definition at line 909 of file SourceCode.cpp.
Referenced by clang::clangd::SpelledWord::touching().
bool clang::clangd::isLiteralInclude | ( | llvm::StringRef | Include | ) |
Returns true if Include
is literal include like "path" or <path>.
Definition at line 134 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 745 of file Preamble.cpp.
References clang::clangd::ParseInputs::CompileCommand, clang::clangd::ParseInputs::Contents, Preamble, clang::clangd::ParseInputs::TFS, and clang::clangd::ThreadsafeFS::view().
bool clang::clangd::isPreferredProvider | ( | const Inclusion & | , |
const include_cleaner::Includes & | , | ||
llvm::ArrayRef< include_cleaner::Header > | Providers ) |
Whether this #include is considered to provide a particular symbol.
This means it satisfies the reference, and no other #include does better. Providers is the symbol's candidate headers according to walkUsed().
Definition at line 488 of file IncludeCleaner.cpp.
References clang::clangd::Inclusion::HashLine, and isPreferredProvider().
Referenced by isPreferredProvider().
bool clang::clangd::isProtoFile | ( | SourceLocation | Loc, |
const SourceManager & | SM ) |
Returns true if the given location is in a generated protobuf file.
Definition at line 1232 of file SourceCode.cpp.
bool clang::clangd::isRegisteredTidyCheck | ( | llvm::StringRef | Check | ) |
Returns if Check
is a registered clang-tidy check.
must
not be empty, must not contain '*' or ',' or start with '-'. Definition at line 302 of file TidyProvider.cpp.
|
inline |
Returns true if Name is reserved, like _Foo or __Vector_base.
Definition at line 334 of file SourceCode.h.
Referenced by hasReservedName(), clang::clangd::SymbolQualitySignals::merge(), and 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:
Definition at line 231 of file SourceCode.cpp.
Referenced by isImplementationDetail(), and nameLocation().
std::vector< Diag > clang::clangd::issueIncludeCleanerDiagnostics | ( | ParsedAST & | AST, |
llvm::StringRef | Code, | ||
const IncludeCleanerFindings & | Findings, | ||
const ThreadsafeFS & | TFS, | ||
HeaderFilter | IgnoreHeaders, | ||
HeaderFilter | AngledHeaders, | ||
HeaderFilter | QuotedHeaders ) |
Definition at line 502 of file IncludeCleaner.cpp.
References AST, issueIncludeCleanerDiagnostics(), clang::clangd::IncludeCleanerFindings::MissingIncludes, and clang::clangd::IncludeCleanerFindings::UnusedIncludes.
Referenced by issueIncludeCleanerDiagnostics().
bool clang::clangd::isValidFileRange | ( | const SourceManager & | Mgr, |
SourceRange | R ) |
Returns true iff all of the following conditions hold:
Definition at line 249 of file SourceCode.cpp.
Referenced by toHalfOpenFileRange(), and toSourceCode().
|
static |
Definition at line 63 of file SourceCode.cpp.
References elog().
Referenced by lspLength(), and measureUnits().
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 | ) |
TokenStream clang::clangd::lex | ( | const std::string & | , |
const clang::LangOptions & | ) |
Extracts a raw token stream from the source code.
All tokens will reference the data of the provided string. "word-like" tokens such as identifiers and keywords will be raw_identifier.
Definition at line 19 of file Lex.cpp.
References clang::clangd::Token::Data, clang::clangd::TokenStream::finalize(), clang::clangd::Token::Indent, clang::clangd::Token::Kind, clang::clangd::Token::Length, clang::clangd::Token::Line, NeedsCleaning, clang::clangd::Token::OriginalIndex, clang::clangd::TokenStream::push(), clang::clangd::Token::setFlag(), and StartsPPLine.
|
static |
Definition at line 621 of file SourceCode.cpp.
Referenced by collectIdentifierRanges(), collectIdentifiers(), and getFoldingRanges().
clang::clangd::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE | ( | ) |
std::unique_ptr< SymbolIndex > clang::clangd::loadIndex | ( | llvm::StringRef | SymbolFilename, |
SymbolOrigin | Origin, | ||
bool | UseDex, | ||
bool | SupportContainedRefs ) |
Definition at line 706 of file Serialization.cpp.
References clang::clangd::dex::Dex::build(), clang::clangd::MemIndex::build(), elog(), readIndexFile(), Symbols, and vlog().
Referenced by main().
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 120 of file BackgroundIndexLoader.cpp.
std::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 999 of file SourceCode.cpp.
References translatePreamblePatchLocation().
Referenced by collectMacroReferences(), findReferences(), getHover(), getSymbolInfo(), and rename().
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 776 of file XRefs.cpp.
References AST, Deduced, elog(), File, findNearbyIdentifier(), getDeducedType(), locateSymbolTextually(), log(), Macro, sourceLocationInMainFile(), clang::clangd::SpelledWord::touching(), and vlog().
Referenced by clang::clangd::ClangdServer::locateSymbolAt().
std::vector< LocatedSymbol > clang::clangd::locateSymbolTextually | ( | const SpelledWord & | Word, |
ParsedAST & | AST, | ||
const SymbolIndex * | Index, | ||
llvm::StringRef | MainFilePath, | ||
ASTNodeKind | NodeKind ) |
Definition at line 575 of file XRefs.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, AST, clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::LocatedSymbol::Definition, clang::clangd::Symbol::Definition, dlog, clang::clangd::SymbolQualitySignals::evaluateHeuristics(), clang::clangd::SymbolRelevanceSignals::evaluateHeuristics(), evaluateSymbolAndRelevance(), clang::clangd::SpelledWord::ExpandedToken, clang::clangd::SymbolIndex::fuzzyFind(), clang::clangd::SymbolRelevanceSignals::Generic, clang::clangd::LocatedSymbol::ID, clang::clangd::Symbol::ID, indexToLSPLocation(), clang::clangd::SpelledWord::LikelyIdentifier, clang::clangd::FuzzyFindRequest::Limit, clang::clangd::SpelledWord::Location, log(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::LocatedSymbol::Name, clang::clangd::Symbol::Name, clang::clangd::SymbolRelevanceSignals::Name, clang::clangd::SpelledWord::PartOfSpelledToken, clang::clangd::LocatedSymbol::PreferredDeclaration, clang::clangd::FuzzyFindRequest::ProximityPaths, clang::clangd::FuzzyFindRequest::Query, clang::clangd::SymbolRelevanceSignals::Query, clang::clangd::Symbol::Scope, clang::clangd::FuzzyFindRequest::Scopes, clang::clangd::Symbol::SymInfo, clang::clangd::Symbol::TemplateSpecializationArgs, clang::clangd::SpelledWord::Text, visibleNamespaces(), and vlog().
Referenced by locateSymbolAt().
void clang::clangd::log | ( | const char * | Fmt, |
Ts &&... | Vals ) |
Definition at line 67 of file Logger.h.
References clang::clangd::Logger::Info, and clang::clangd::detail::log().
Referenced by clang::clangd::ParsedAST::build(), buildPreamble(), check(), clangdMain(), clang::clangd::ClangdServer::createConfiguredContextProvider(), clang::clangd::URIDistance::distance(), clang::clangd::DirectoryBasedGlobalCompilationDatabase::BroadcastThread::Filter::filter(), clang::clangd::DirectoryBasedGlobalCompilationDatabase::getCompileCommand(), getFormatStyleForFile(), clang::clangd::ModulesBuilder::ModulesBuilderImpl::getOrBuildModuleFile(), clang::clangd::OverlayCDB::getProjectModules(), indexStandardLibrary(), inferFinalNewline(), locateSymbolAt(), locateSymbolTextually(), clang::clangd::ClangdLSPServer::MessageHandler::onCall(), clang::clangd::ClangdLSPServer::MessageHandler::onNotify(), clang::clangd::ClangdLSPServer::MessageHandler::onReply(), clang::clangd::config::Fragment::parseYAML(), and updateVersion().
|
static |
Definition at line 78 of file LSPClient.cpp.
References Method, and vlog().
Referenced by clang::clangd::LSPClient::call(), and clang::clangd::LSPClient::notify().
std::vector< std::string > clang::clangd::lookup | ( | const SymbolIndex & | I, |
llvm::ArrayRef< SymbolID > | IDs ) |
Definition at line 151 of file TestIndex.cpp.
References getQualifiedName(), clang::clangd::LookupRequest::IDs, and clang::clangd::SymbolIndex::lookup().
|
static |
Definition at line 68 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::FuzzyMatcher().
|
static |
Definition at line 143 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 149 of file SourceCode.cpp.
References iterateCodepoints(), lspEncoding(), UnsupportedEncoding, UTF16, UTF32, and UTF8.
Referenced by applyChange(), offsetToPosition(), rangeTillEOL(), and sourceLocToPosition().
size_t clang::clangd::lspLength | ( | StringRef | Code | ) |
Symbol clang::clangd::macro | ( | llvm::StringRef | Name, |
llvm::StringRef | ArgList ) |
Definition at line 90 of file TestIndex.cpp.
References sym().
std::vector< std::string > clang::clangd::match | ( | const SymbolIndex & | I, |
const FuzzyFindRequest & | Req, | ||
bool * | Incomplete ) |
Definition at line 139 of file TestIndex.cpp.
References clang::clangd::SymbolIndex::fuzzyFind(), and getQualifiedName().
clang::clangd::MATCHER | ( | declared | , |
"" | ) |
Definition at line 32 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER | ( | defined | , |
"" | ) |
Definition at line 35 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER | ( | emptyIncludeNode | , |
"" | ) |
Definition at line 42 of file BackgroundIndexTests.cpp.
References clang::clangd::IncludeGraphNode::None.
clang::clangd::MATCHER | ( | hadErrors | , |
"" | ) |
Definition at line 47 of file BackgroundIndexTests.cpp.
References clang::clangd::IncludeGraphNode::HadErrors.
clang::clangd::MATCHER_P | ( | fileURI | , |
F | , | ||
"" | ) |
Definition at line 36 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | named | , |
N | , | ||
"" | ) |
Definition at line 30 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | numReferences | , |
N | , | ||
"" | ) |
Definition at line 51 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P | ( | qName | , |
N | , | ||
"" | ) |
Definition at line 31 of file BackgroundIndexTests.cpp.
clang::clangd::MATCHER_P2 | ( | FileWithContents | , |
FileName | , | ||
Contents | , | ||
"" | ) |
Definition at line 103 of file TweakTesting.h.
Definition at line 500 of file GlobalCompilationDatabaseTests.cpp.
References hasFlag(), and printArgv().
std::string clang::clangd::maybeCaseFoldPath | ( | PathRef | Path | ) |
std::optional< unsigned > clang::clangd::maybeFunctionArgumentCommentStart | ( | llvm::StringRef | Content | ) |
Definition at line 2260 of file CodeComplete.cpp.
Referenced by codeComplete().
|
static |
Definition at line 105 of file SourceCode.cpp.
References iterateCodepoints(), UnsupportedEncoding, UTF16, UTF32, and UTF8.
Referenced by positionToOffset().
|
static |
Definition at line 141 of file TidyProvider.cpp.
References Checks().
Referenced by addTidyChecks(), and provideClangdConfig().
Definition at line 240 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 ) |
Find the source location of the identifier for D
.
Transforms macro locations to locations spelled inside files. All code that needs locations of declaration names (e.g. the index) should go through this function.
Definition at line 195 of file AST.cpp.
References isSpelledInSource().
Referenced by declToHierarchyItem(), and getSymbolInfo().
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 327 of file JSONTransport.cpp.
Referenced by clangdMain(), and LLVMFuzzerTestOneInput().
std::unique_ptr< Transport > clang::clangd::newXPCTransport | ( | ) |
Definition at line 214 of file XPCTransport.cpp.
Referenced by clangdMain().
llvm::StringRef clang::clangd::normalizeSuppressedCode | ( | llvm::StringRef | ) |
Take a user-specified diagnostic code, and convert it to a normalized form stored in the config and consumed by isDiagnosticsSuppressed.
(This strips err_ and -W prefix so we can match with or without them.)
Definition at line 929 of file Diagnostics.cpp.
Referenced by isDiagnosticSuppressed().
Symbol clang::clangd::ns | ( | llvm::StringRef | Name | ) |
Definition at line 82 of file TestIndex.cpp.
References sym().
Symbol clang::clangd::objcCategory | ( | llvm::StringRef | Name, |
llvm::StringRef | CategoryName ) |
Definition at line 112 of file TestIndex.cpp.
References objcSym().
Symbol clang::clangd::objcClass | ( | llvm::StringRef | Name | ) |
Definition at line 108 of file TestIndex.cpp.
References objcSym().
Symbol clang::clangd::objcProtocol | ( | llvm::StringRef | Name | ) |
Definition at line 117 of file TestIndex.cpp.
References objcSym().
Symbol clang::clangd::objcSym | ( | llvm::StringRef | Name, |
index::SymbolKind | Kind, | ||
llvm::StringRef | USRPrefix ) |
Definition at line 94 of file TestIndex.cpp.
References clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, clang::clangd::Symbol::IndexedForCodeCompletion, clang::clangd::Symbol::Name, clang::clangd::Symbol::Origin, clang::clangd::Symbol::Scope, Static, and clang::clangd::Symbol::SymInfo.
Referenced by objcCategory(), objcClass(), and objcProtocol().
std::pair< size_t, size_t > clang::clangd::offsetToClangLineColumn | ( | llvm::StringRef | Code, |
size_t | Offset ) |
Definition at line 487 of file SourceCode.cpp.
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 202 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and lspLength().
Referenced by codeCompleteComment(), getEligiblePoints(), getFoldingRanges(), clang::clangd::Annotations::points(), clang::clangd::Annotations::pointsWithPayload(), clang::clangd::Annotations::pointWithPayload(), rangeTillEOL(), replacementToEdit(), and toLSPRange().
bool clang::clangd::operator!= | ( | const SymbolRange & | LHS, |
const SymbolRange & | RHS ) |
Definition at line 1069 of file Rename.cpp.
|
inline |
Definition at line 213 of file FindTarget.h.
|
inline |
|
inlineconstexpr |
|
inline |
Definition at line 42 of file SymbolOrigin.h.
bool clang::clangd::operator< | ( | const CompletionItem & | L, |
const CompletionItem & | R ) |
Definition at line 1191 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 1340 of file SemanticHighlighting.cpp.
References clang::clangd::HighlightingToken::Kind, clang::clangd::HighlightingToken::Modifiers, and clang::clangd::HighlightingToken::R.
Definition at line 1564 of file Protocol.cpp.
bool clang::clangd::operator< | ( | const InlayHintLabelPart & | LHS, |
const InlayHintLabelPart & | RHS ) |
Definition at line 1607 of file Protocol.cpp.
References clang::clangd::InlayHintLabelPart::location, and clang::clangd::InlayHintLabelPart::value.
Definition at line 98 of file Ref.h.
References clang::clangd::Ref::Container, 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().
bool clang::clangd::operator< | ( | const SymbolRange & | LHS, |
const SymbolRange & | RHS ) |
Definition at line 1072 of file Rename.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const CompletionItem & | I ) |
Definition at line 1186 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 1346 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 951 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 1228 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 906 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 865 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 1411 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const ASTNode & | Root ) |
Definition at line 1736 of file Protocol.cpp.
References clang::clangd::ASTNode::children, clang::clangd::ASTNode::detail, clang::clangd::ASTNode::kind, and clang::clangd::ASTNode::role.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const CodeCompleteResult & | R ) |
Definition at line 2443 of file CodeComplete.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const CodeCompletion & | C ) |
Definition at line 2435 of file CodeComplete.cpp.
Referenced by operator<<(), and operator<<().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diag & | D ) |
Definition at line 418 of file Diagnostics.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const DiagBase & | D ) |
Definition at line 399 of file Diagnostics.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diagnostic & | D ) |
Definition at line 792 of file Protocol.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Fix & | F ) |
Definition at line 408 of file Diagnostics.cpp.
References clang::clangd::Fix::Edits, and clang::clangd::Fix::Message.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const HoverInfo::Param & | P ) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const HoverInfo::PrintedType & | T ) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Inclusion & | Inc ) |
Definition at line 350 of file Headers.cpp.
References clang::clangd::Inclusion::HashLine, 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 681 of file Serialization.cpp.
References clang::clangd::IndexFileOut::Format, RIFF, writeYAML(), and YAML.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const InlayHintLabelPart & | L ) |
Definition at line 1611 of file Protocol.cpp.
References clang::clangd::InlayHintLabelPart::location, and clang::clangd::InlayHintLabelPart::value.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const LocatedSymbol & | S ) |
Definition at line 1728 of file XRefs.cpp.
References clang::clangd::LocatedSymbol::Definition, clang::clangd::LocatedSymbol::Name, operator<<(), and clang::clangd::LocatedSymbol::PreferredDeclaration.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Location & | L ) |
Definition at line 161 of file Protocol.cpp.
References 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 164 of file PathMapping.cpp.
References clang::clangd::PathMapping::ClientPath, and clang::clangd::PathMapping::ServerPath.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Position & | P ) |
Definition at line 134 of file Protocol.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Range & | R ) |
Definition at line 150 of file Protocol.cpp.
References clang::clangd::Range::end, 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, and clang::clangd::Ref::Location.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const ReferenceLocation & | L ) |
Definition at line 175 of file Protocol.cpp.
References clang::clangd::ReferenceLocation::containerName, clang::clangd::Location::range, and clang::clangd::Location::uri.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const ReferencesResult::Reference & | R ) |
Definition at line 1735 of file XRefs.cpp.
References clang::clangd::ReferencesResult::Reference::Attributes, clang::clangd::ReferencesResult::Declaration, clang::clangd::ReferencesResult::Definition, clang::clangd::ReferencesResult::Reference::Loc, operator<<(), and clang::clangd::ReferencesResult::Override.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Relation & | R ) |
Definition at line 26 of file Relation.cpp.
References clang::clangd::Relation::Object, clang::clangd::Relation::Predicate, and clang::clangd::Relation::Subject.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const RelationKind | R ) |
Definition at line 16 of file Relation.cpp.
References BaseOf, and OverriddenBy.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SignatureQualitySignals & | S ) |
Definition at line 563 of file Quality.cpp.
References clang::clangd::SignatureQualitySignals::Kind, clang::clangd::SignatureQualitySignals::NumberOfOptionalParameters, and clang::clangd::SignatureQualitySignals::NumberOfParameters.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Symbol & | S ) |
Definition at line 27 of file Symbol.cpp.
References clang::clangd::Symbol::Name, 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.
References clang::clangd::SymbolID::raw().
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 249 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Category, clang::clangd::SymbolQualitySignals::Deprecated, clang::clangd::SymbolQualitySignals::evaluateHeuristics(), clang::clangd::SymbolQualitySignals::ImplementationDetail, 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 493 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::calculateDerivedSignals(), clang::clangd::SymbolRelevanceSignals::Context, clang::clangd::SymbolRelevanceSignals::ContextWords, clang::clangd::SymbolRelevanceSignals::evaluateHeuristics(), clang::clangd::SymbolRelevanceSignals::DerivedSignals::FileProximityDistance, clang::clangd::SymbolRelevanceSignals::FileProximityMatch, fileProximityScore(), clang::clangd::SymbolRelevanceSignals::Forbidden, clang::clangd::SymbolRelevanceSignals::HadContextType, clang::clangd::SymbolRelevanceSignals::HadSymbolType, clang::clangd::SymbolRelevanceSignals::InBaseClass, clang::clangd::SymbolRelevanceSignals::IsInstanceMember, clang::clangd::SymbolRelevanceSignals::Name, clang::clangd::SymbolRelevanceSignals::NameMatch, clang::clangd::SymbolRelevanceSignals::NeedsFixIts, clang::clangd::SymbolRelevanceSignals::Query, clang::clangd::SymbolRelevanceSignals::Scope, clang::clangd::SymbolRelevanceSignals::DerivedSignals::ScopeProximityDistance, clang::clangd::SymbolRelevanceSignals::ScopeProximityMatch, scopeProximityScore(), clang::clangd::SymbolRelevanceSignals::SemaFileProximityScore, clang::clangd::SymbolRelevanceSignals::SemaSaysInScope, clang::clangd::SymbolRelevanceSignals::SymbolScope, clang::clangd::SymbolRelevanceSignals::SymbolURI, clang::clangd::SymbolRelevanceSignals::TypeMatchesPreferred, and wordMatching().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolSlab & | Slab ) |
Definition at line 69 of file Symbol.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const TextEdit & | TE ) |
Definition at line 232 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Token & | T ) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Token::Range & | R ) |
Definition at line 44 of file Token.cpp.
References clang::clangd::Token::Range::Begin, and clang::clangd::Token::Range::End.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const TokenStream & | TS ) |
Definition at line 29 of file Token.cpp.
References clang::clangd::TokenStream::index(), and clang::clangd::TokenStream::tokens().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const URIForFile & | U ) |
Definition at line 94 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
DeclRelation | R ) |
Definition at line 1149 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 1162 of file FindTarget.cpp.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
HighlightingKind | K ) |
Definition at line 1209 of file SemanticHighlighting.cpp.
References Bracket, Class, Concept, Enum, EnumConstant, Field, Function, InactiveCode, Interface, Label, LocalVariable, Macro, Method, Modifier, Namespace, Operator, Parameter, Primitive, StaticField, StaticMethod, TemplateParameter, Type, Typedef, Unknown, and Variable.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
HighlightingModifier | K ) |
Definition at line 1296 of file SemanticHighlighting.cpp.
References ConstructorOrDestructor, Declaration, Definition, and toSemanticTokenModifier().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
InlayHintKind | Kind ) |
Definition at line 1573 of file Protocol.cpp.
References BlockEnd, DefaultArgument, Designator, Parameter, and Type.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
MarkupKind | K ) |
Definition at line 1068 of file Protocol.cpp.
References toTextKind().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
OffsetEncoding | Enc ) |
Definition at line 1645 of file Protocol.cpp.
References toString().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
ReferenceLoc | R ) |
Definition at line 1173 of file FindTarget.cpp.
References clang::clangd::ReferenceLoc::IsDecl, 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 16 of file Symbol.cpp.
References clang::clangd::Symbol::Deprecated, clang::clangd::Symbol::IndexedForCodeCompletion, and clang::clangd::Symbol::None.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
SymbolOrigin | O ) |
Definition at line 14 of file SymbolOrigin.cpp.
References Unknown.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | Stream, |
const CallHierarchyIncomingCall & | Call ) |
Definition at line 26 of file CallHierarchyTests.cpp.
References Call.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | Stream, |
const CallHierarchyItem & | Item ) |
Definition at line 21 of file CallHierarchyTests.cpp.
References clang::clangd::CallHierarchyItem::name, and clang::clangd::CallHierarchyItem::selectionRange.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | Stream, |
const InlayHint & | Hint ) |
Definition at line 29 of file InlayHintTests.cpp.
References clang::clangd::InlayHint::joinLabels(), and clang::clangd::InlayHint::range.
bool clang::clangd::operator== | ( | const HighlightingToken & | L, |
const HighlightingToken & | R ) |
Definition at line 1336 of file SemanticHighlighting.cpp.
References clang::clangd::HighlightingToken::Kind, clang::clangd::HighlightingToken::Modifiers, and clang::clangd::HighlightingToken::R.
|
inline |
Definition at line 160 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 147 of file Hover.h.
References clang::clangd::HoverInfo::PassType::Converted, and clang::clangd::HoverInfo::PassType::PassBy.
|
inline |
Definition at line 142 of file Hover.h.
References clang::clangd::HoverInfo::PrintedType::AKA, and clang::clangd::HoverInfo::PrintedType::Type.
Definition at line 356 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.
Definition at line 1560 of file Protocol.cpp.
bool clang::clangd::operator== | ( | const InlayHintLabelPart & | LHS, |
const InlayHintLabelPart & | RHS ) |
Definition at line 1603 of file Protocol.cpp.
References clang::clangd::InlayHintLabelPart::location, and clang::clangd::InlayHintLabelPart::value.
Definition at line 102 of file Ref.h.
References clang::clangd::Ref::Container, clang::clangd::Ref::Kind, and clang::clangd::Ref::Location.
bool clang::clangd::operator== | ( | const SemanticToken & | L, |
const SemanticToken & | R ) |
Definition at line 1299 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 871 of file Protocol.cpp.
References clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::declarationRange, clang::clangd::SymbolDetails::definitionRange, 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().
bool clang::clangd::operator== | ( | const SymbolRange & | LHS, |
const SymbolRange & | RHS ) |
Definition at line 1066 of file Rename.cpp.
Definition at line 256 of file Protocol.h.
References clang::clangd::TextEdit::annotationId, clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
|
inline |
Definition at line 210 of file FindTarget.h.
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
Definition at line 35 of file SymbolOrigin.h.
|
inline |
|
inline |
|
inline |
Definition at line 39 of file SymbolOrigin.h.
|
inline |
Definition at line 216 of file FindTarget.h.
std::vector< CallHierarchyOutgoingCall > clang::clangd::outgoingCalls | ( | const CallHierarchyItem & | Item, |
const SymbolIndex * | Index ) |
Definition at line 2404 of file XRefs.cpp.
References clang::clangd::SymbolIndex::containedRefs(), clang::clangd::CallHierarchyItem::data, elog(), clang::clangd::URIForFile::file(), clang::clangd::SymbolID::fromStr(), clang::clangd::ContainedRefsRequest::ID, clang::clangd::LookupRequest::IDs, indexToLSPLocation(), clang::clangd::SymbolIndex::lookup(), outgoingCalls(), clang::clangd::Location::range, symbolToCallHierarchyItem(), clang::clangd::CallHierarchyItem::uri, and clang::clangd::Location::uri.
Referenced by clang::clangd::ClangdServer::outgoingCalls(), and outgoingCalls().
|
static |
Definition at line 48 of file Symbol.cpp.
References visitStrings().
Referenced by clang::clangd::SymbolSlab::Builder::insert().
|
static |
Definition at line 151 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
void clang::clangd::pairBrackets | ( | TokenStream & | ) |
Identifies bracket token in the stream which should be paired.
Sets Token::Pair accordingly.
Definition at line 148 of file Bracket.cpp.
Referenced by getFoldingRanges().
std::vector< Token::Range > clang::clangd::pairDirectiveRanges | ( | const DirectiveTree & | Tree, |
const TokenStream & | Code ) |
Pairs preprocessor conditional directives and computes their token ranges.
Definition at line 400 of file DirectiveTree.cpp.
References clang::clangd::Token::flag(), clang::clangd::Token::Kind, clang::clangd::Token::OriginalIndex, StartsPPLine, and clang::clangd::TokenStream::tokens().
Referenced by getFoldingRanges().
void clang::clangd::parseDocumentation | ( | llvm::StringRef | Input, |
markup::Document & | Output ) |
Definition at line 1783 of file Hover.cpp.
References parseDocumentationParagraph().
void clang::clangd::parseDocumentationParagraph | ( | llvm::StringRef | Text, |
markup::Paragraph & | Out ) |
Definition at line 1767 of file Hover.cpp.
References clang::clangd::markup::Paragraph::appendText(), getBacktickQuoteRange(), parseDocumentationParagraph(), and Text.
Referenced by parseDocumentation(), and parseDocumentationParagraph().
|
static |
Definition at line 266 of file GlobalCompilationDatabase.cpp.
References Error.
|
static |
Definition at line 249 of file GlobalCompilationDatabase.cpp.
References Error.
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 169 of file PathMapping.cpp.
References error().
Referenced by clangdMain().
|
static |
Definition at line 775 of file Preamble.cpp.
Definition at line 19 of file Path.cpp.
Referenced by getCorrespondingHeaderOrSource(), and pathStartsWith().
bool clang::clangd::pathStartsWith | ( | PathRef | Ancestor, |
PathRef | Path, | ||
llvm::sys::path::Style | Style = llvm::sys::path::Style::native ) |
Checks if Ancestor
is a proper ancestor of Path
.
This is just a smarter lexical prefix match, e.g: foo/bar/baz doesn't start with foo/./bar. Both Ancestor
and Path
must be absolute.
Definition at line 36 of file Path.cpp.
References pathEqual().
Referenced by clang::clangd::TestScheme::getAbsolutePath().
std::string clang::clangd::platformString | ( | ) |
Definition at line 20 of file Feature.cpp.
Referenced by clangdMain().
|
static |
Definition at line 1041 of file Selection.cpp.
Referenced by clang::clangd::SelectionTree::createEach().
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 173 of file SourceCode.cpp.
References error(), lspEncoding(), and measureUnits().
Referenced by applyChange(), buildRenameEdit(), codeComplete(), findRecordTypeAt(), findType(), clang::clangd::ClangdServer::formatFile(), clang::clangd::ClangdServer::formatOnType(), clang::clangd::ClangdServer::getAST(), getSemanticRanges(), rename(), signatureHelp(), sourceLocationInMainFile(), and toSemanticTokens().
|
static |
Definition at line 226 of file Merge.cpp.
Referenced by mergeSymbol().
Symbol::IncludeDirective clang::clangd::preferredIncludeDirective | ( | llvm::StringRef | FileName, |
const LangOptions & | LangOpts, | ||
ArrayRef< Inclusion > | MainFileIncludes, | ||
ArrayRef< const Decl * > | TopLevelDecls ) |
Infer the include directive to use for the given FileName
.
It aims for #import for ObjC files and #include for the rest.
Definition at line 384 of file AST.cpp.
References clang::clangd::Symbol::Import, clang::clangd::Symbol::Include, and isHeaderFile().
Referenced by clang::clangd::ParsedAST::build(), and clang::clangd::ASTSignals::derive().
std::vector< CallHierarchyItem > clang::clangd::prepareCallHierarchy | ( | ParsedAST & | AST, |
Position | Pos, | ||
PathRef | TUPath ) |
Get call hierarchy information at Pos
.
Definition at line 2309 of file XRefs.cpp.
References AST, declToCallHierarchyItem(), elog(), prepareCallHierarchy(), and sourceLocationInMainFile().
Referenced by clang::clangd::ClangdServer::prepareCallHierarchy(), and prepareCallHierarchy().
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 130 of file Compiler.cpp.
References Preamble.
Referenced by clang::clangd::ParsedAST::build(), and indexStandardLibrary().
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, | ||
const FeatureModuleSet * | Modules ) |
Definition at line 91 of file Tweak.cpp.
References error().
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, | ||
const FeatureModuleSet * | Modules ) |
Calls prepare() on all tweaks that satisfy the filter, returning those that can run on the selection.
Definition at line 72 of file Tweak.cpp.
Referenced by clang::clangd::ClangdServer::codeAction().
std::string clang::clangd::printArgv | ( | llvm::ArrayRef< llvm::StringRef > | Args | ) |
Definition at line 621 of file CompileCommands.cpp.
Referenced by MATCHER_P2(), and printArgv().
std::string clang::clangd::printArgv | ( | llvm::ArrayRef< std::string > | Args | ) |
Definition at line 641 of file CompileCommands.cpp.
References printArgv().
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 246 of file AST.cpp.
References getQualifierLoc(), isAnonymous(), and printTemplateSpecializationArgs().
Referenced by declToHierarchyItem().
std::string clang::clangd::printNamespaceScope | ( | const DeclContext & | DC | ) |
Returns the first enclosing namespace scope starting from DC
.
Definition at line 301 of file AST.cpp.
References printQualifiedName().
Referenced by collectAccessibleScopes(), clang::clangd::SymbolRelevanceSignals::computeASTSignals(), and extractUnresolvedNameCheaply().
std::string clang::clangd::printObjCContainer | ( | const ObjCContainerDecl & | C | ) |
Print the Objective-C container name including categories, e.g. MyClass,.
Definition at line 333 of file AST.cpp.
References Class, and getNameOrErrForObjCInterface().
Referenced by printObjCMethod().
std::string clang::clangd::printObjCMethod | ( | const ObjCMethodDecl & | Method | ) |
Print the Objective-C method name, including the full container name, e.g.
-[MyClass(Category) method:]
Definition at line 314 of file AST.cpp.
References Method, and printObjCContainer().
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 205 of file AST.cpp.
Referenced by getSymbolInfo(), 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 285 of file AST.cpp.
Referenced by operator<<(), and printName().
std::string clang::clangd::printType | ( | const QualType | QT, |
const DeclContext & | CurContext, | ||
llvm::StringRef | Placeholder = "", | ||
bool | FullyQualify = false ) |
std::string clang::clangd::printUsingNamespaceName | ( | const ASTContext & | Ctx, |
const UsingDirectiveDecl & | D ) |
TidyProvider clang::clangd::provideClangdConfig | ( | ) |
Definition at line 255 of file TidyProvider.cpp.
References clang::tidy::ClangTidyOptions::CheckOptions, clang::tidy::ClangTidyOptions::Checks, clang::clangd::Config::ClangTidy, clang::clangd::Config::current(), clang::clangd::Config::Diagnostics, and mergeCheckList().
Referenced by clangdMain().
TidyProvider clang::clangd::provideClangTidyFiles | ( | ThreadsafeFS & | TFS | ) |
Provider that searches for .clang-tidy configuration files in the directory tree.
Definition at line 268 of file TidyProvider.cpp.
Referenced by clangdMain().
TidyProvider clang::clangd::provideDefaultChecks | ( | ) |
Provider that will enable a nice set of default checks if none are specified.
Definition at line 170 of file TidyProvider.cpp.
References clang::tidy::ClangTidyOptions::Checks, and DefaultChecks.
Referenced by clangdMain().
TidyProvider clang::clangd::provideEnvironment | ( | ) |
Provider that just sets the defaults.
Definition at line 152 of file TidyProvider.cpp.
References clang::tidy::ClangTidyOptions::User.
Referenced by clangdMain().
std::optional< std::string > clang::clangd::qualifiedByUnresolved | ( | const SourceManager & | SM, |
SourceLocation | Loc, | ||
const LangOptions & | LangOpts ) |
Definition at line 349 of file clangd/IncludeFixer.cpp.
Referenced by extractUnresolvedNameCheaply().
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 31 of file Symbol.cpp.
References clang::clangd::Symbol::References.
|
static |
Definition at line 345 of file SourceCode.cpp.
References includeHashLoc(), and toTokenRange().
Referenced by getExpansionTokenRangeInSameFile(), and toHalfOpenFileRange().
clangd::Range clang::clangd::rangeTillEOL | ( | llvm::StringRef | Code, |
unsigned | HashOffset ) |
Returns the range starting at offset and spanning the whole line.
Escaped newlines are not handled.
Definition at line 1264 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Range::end, lspLength(), offsetToPosition(), and clang::clangd::Range::start.
llvm::Expected< IndexFileIn > clang::clangd::readIndexFile | ( | llvm::StringRef | Data, |
SymbolOrigin | Origin ) |
Definition at line 693 of file Serialization.cpp.
References error(), and readYAML().
Referenced by loadIndex(), and clang::clangd::MemoryShardStorage::loadShard().
llvm::Expected< IndexFileIn > clang::clangd::readYAML | ( | llvm::StringRef | Data, |
SymbolOrigin | Origin ) |
Definition at line 473 of file YAMLSerialization.cpp.
References clang::clangd::IndexFileIn::Cmd, clang::clangd::IndexFileIn::Refs, clang::clangd::IndexFileIn::Relations, clang::clangd::IndexFileIn::Sources, Symbols, and clang::clangd::IndexFileIn::Symbols.
Referenced by readIndexFile().
void clang::clangd::record | ( | const MemoryTree & | MT, |
std::string | RootName, | ||
const trace::Metric & | Out ) |
Records total memory usage of each node under Out
.
Labels are edges on the path joined with ".", starting with RootName
.
Definition at line 53 of file MemoryTree.cpp.
|
static |
Definition at line 1176 of file SymbolCollector.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 1080 of file SourceCode.cpp.
References cleanupAndFormat(), clang::clangd::Edit::InitialCode, and clang::clangd::Edit::Replacements.
Referenced by clang::clangd::ClangdServer::applyTweak(), and clang::clangd::ClangdServer::rename().
::testing::Matcher< const RefSlab & > clang::clangd::refsAre | ( | std::vector<::testing::Matcher< Ref > > | Matchers | ) |
Definition at line 38 of file BackgroundIndexTests.cpp.
Referenced by TEST_F().
void clang::clangd::removeCompletionLabelDetails | ( | CompletionItem & | ) |
Remove the labelDetails field (for clients that don't support it).
Places the information into other fields of the completion item.
Definition at line 1147 of file Protocol.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 116 of file FS.cpp.
References File.
Referenced by clang::clangd::OverlayCDB::getCompileCommand(), and clang::clangd::OverlayCDB::setCompileCommand().
llvm::Expected< RenameResult > 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 1076 of file Rename.cpp.
References clang::clangd::RenameInputs::AST, AST, clang::clangd::Edit::asTextEdits(), clang::clangd::trace::Metric::Counter, clang::clangd::Range::end, clang::clangd::RenameInputs::FS, clang::clangd::RenameResult::GlobalChanges, halfOpenToRange(), clang::clangd::RenameInputs::Index, clang::clangd::RenameResult::LocalChanges, locateMacroAt(), clang::clangd::RenameInputs::MainFilePath, clang::clangd::RenameInputs::NewName, clang::clangd::RenameInputs::Opts, clang::clangd::RenameResult::Placeholder, clang::clangd::RenameInputs::Pos, positionToOffset(), clang::clangd::trace::Metric::record(), sourceLocationInMainFile(), clang::clangd::Range::start, and clang::clangd::RenameResult::Target.
Referenced by clang::clangd::ClangdServer::prepareRename(), and clang::clangd::ClangdServer::rename().
size_t clang::clangd::renameRangeAdjustmentCost | ( | ArrayRef< Range > | Indexed, |
ArrayRef< SymbolRange > | 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 1364 of file Rename.cpp.
Referenced by getMappedRanges().
|
static |
Definition at line 31 of file TestIndex.cpp.
References replace().
std::vector< TextEdit > clang::clangd::replacementsToEdits | ( | llvm::StringRef | Code, |
const tooling::Replacements & | Repls ) |
Definition at line 512 of file SourceCode.cpp.
References replacementToEdit().
Referenced by clang::clangd::Edit::asTextEdits().
std::vector< TextEdit > clang::clangd::replacementsToEdits | ( | StringRef | Code, |
const tooling::Replacements & | Repls ) |
References File.
TextEdit clang::clangd::replacementToEdit | ( | llvm::StringRef | Code, |
const tooling::Replacement & | R ) |
Definition at line 504 of file SourceCode.cpp.
References offsetToPosition().
Referenced by clang::clangd::ClangdServer::formatOnType(), clang::clangd::IncludeInserter::insert(), and replacementsToEdits().
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 clangdMain(), and main().
llvm::SmallVector< const ParmVarDecl * > clang::clangd::resolveForwardingParameters | ( | const FunctionDecl * | D, |
unsigned | MaxDepth = 10 ) |
Recursively resolves the parameters of a FunctionDecl that forwards its parameters to another function via variadic template parameters.
This can for example be used to retrieve the constructor parameter ParmVarDecl for a make_unique or emplace_back call.
Definition at line 968 of file AST.cpp.
References Head, Info, resolveForwardingParameters(), and Tail.
Referenced by resolveForwardingParameters().
void clang::clangd::resolveTypeHierarchy | ( | TypeHierarchyItem & | Item, |
int | ResolveLevels, | ||
TypeHierarchyDirection | Direction, | ||
const SymbolIndex * | Index ) |
Definition at line 2294 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::children, clang::clangd::TypeHierarchyItem::data, clang::clangd::URIForFile::file(), fillSubTypes(), Parents, resolveTypeHierarchy(), clang::clangd::TypeHierarchyItem::ResolveParams::symbolID, and clang::clangd::TypeHierarchyItem::uri.
Referenced by clang::clangd::ClangdServer::resolveTypeHierarchy(), and 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 70 of file Shutdown.h.
References shutdownRequested().
void clang::clangd::runAddDocument | ( | ClangdServer & | Server, |
PathRef | File, | ||
llvm::StringRef | Contents, | ||
llvm::StringRef | Version, | ||
WantDiagnostics | WantDiags, | ||
bool | ForceRebuild ) |
Definition at line 17 of file SyncAPI.cpp.
References clang::clangd::ClangdServer::addDocument(), clang::clangd::ClangdServer::blockUntilIdleForTest(), and File.
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 127 of file Threading.h.
References clang::clangd::Context::clone(), 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.
References clang::clangd::ClangdServer::codeComplete(), and File.
llvm::Error clang::clangd::runCustomAction | ( | ClangdServer & | Server, |
PathRef | File, | ||
llvm::function_ref< void(InputsAndAST)> | Action ) |
Definition at line 162 of file SyncAPI.cpp.
References AST, clang::clangd::ClangdServer::customAction(), File, clang::clangd::Notification::notify(), and clang::clangd::Notification::wait().
llvm::Expected< std::vector< DocumentHighlight > > clang::clangd::runFindDocumentHighlights | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos ) |
Definition at line 95 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::findDocumentHighlights().
llvm::Expected< tooling::Replacements > clang::clangd::runFormatFile | ( | ClangdServer & | Server, |
PathRef | File, | ||
const std::vector< Range > & | Rngs ) |
Definition at line 119 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::formatFile().
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
const FuzzyFindRequest & | Req ) |
Definition at line 133 of file SyncAPI.cpp.
References clang::clangd::SymbolIndex::fuzzyFind(), and clang::clangd::SymbolSlab::Builder::insert().
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
llvm::StringRef | Query ) |
Definition at line 126 of file SyncAPI.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, clang::clangd::FuzzyFindRequest::Query, and runFuzzyFind().
Referenced by runFuzzyFind(), TEST_F(), TEST_F(), and TEST_F().
SymbolSlab clang::clangd::runFuzzyFind | ( | const SymbolIndex & | Index, |
StringRef | Query ) |
References File.
llvm::Expected< std::vector< LocatedSymbol > > clang::clangd::runLocateSymbolAt | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos ) |
Definition at line 88 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::locateSymbolAt().
llvm::Expected< RenameResult > clang::clangd::runPrepareRename | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
std::optional< std::string > | NewName, | ||
const RenameOptions & | RenameOpts ) |
Definition at line 110 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::prepareRename().
llvm::Expected< RenameResult > clang::clangd::runRename | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
llvm::StringRef | NewName, | ||
const RenameOptions & | RenameOpts ) |
Definition at line 101 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::rename().
llvm::Expected< RenameResult > clang::clangd::runRename | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
StringRef | NewName, | ||
const clangd::RenameOptions & | RenameOpts ) |
References File.
llvm::Expected< std::vector< SelectionRange > > clang::clangd::runSemanticRanges | ( | ClangdServer & | Server, |
PathRef | File, | ||
const std::vector< Position > & | Pos ) |
Definition at line 148 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::semanticRanges().
llvm::Expected< SignatureHelp > clang::clangd::runSignatureHelp | ( | ClangdServer & | Server, |
PathRef | File, | ||
Position | Pos, | ||
MarkupKind | DocumentationFormat ) |
Definition at line 79 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::signatureHelp().
llvm::Expected< std::optional< clangd::Path > > clang::clangd::runSwitchHeaderSource | ( | ClangdServer & | Server, |
PathRef | File ) |
Definition at line 156 of file SyncAPI.cpp.
References File, and clang::clangd::ClangdServer::switchSourceHeader().
std::unique_ptr< ProjectModules > clang::clangd::scanningProjectModules | ( | std::shared_ptr< const clang::tooling::CompilationDatabase > | CDB, |
const ThreadsafeFS & | TFS ) |
Providing modules information for the project by scanning every file.
Definition at line 223 of file ScanningProjectModules.cpp.
Referenced by clang::clangd::DirectoryBasedGlobalCompilationDatabase::getProjectModules().
|
static |
Definition at line 366 of file Quality.cpp.
References clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluateHeuristics(), and operator<<().
|
static |
Definition at line 181 of file FileDistance.cpp.
References scopeToPath().
Referenced by createScopeFileDistance(), clang::clangd::ScopeDistance::distance(), and scopeToPath().
|
static |
Definition at line 485 of file ClangdLSPServer.cpp.
References LastModifier, and toSemanticTokenModifier().
|
static |
Definition at line 477 of file ClangdLSPServer.cpp.
References LastKind, and toSemanticTokenType().
llvm::json::Value clang::clangd::serializeTHIForExtension | ( | TypeHierarchyItem | THI | ) |
Definition at line 1293 of file ClangdLSPServer.cpp.
References Children, clang::clangd::TypeHierarchyItem::children, clang::clangd::TypeHierarchyItem::data, clang::clangd::TypeHierarchyItem::deprecated, clang::clangd::TypeHierarchyItem::detail, clang::clangd::TypeHierarchyItem::kind, clang::clangd::TypeHierarchyItem::name, Parents, clang::clangd::TypeHierarchyItem::parents, clang::clangd::TypeHierarchyItem::range, clang::clangd::TypeHierarchyItem::selectionRange, serializeTHIForExtension(), and clang::clangd::TypeHierarchyItem::uri.
Referenced by serializeTHIForExtension().
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.
Referenced by main(), and retryAfterSignalUnlessShutdown().
SignatureHelp clang::clangd::signatureHelp | ( | PathRef | FileName, |
Position | Pos, | ||
const PreambleData & | Preamble, | ||
const ParseInputs & | ParseInput, | ||
MarkupKind | DocumentationFormat ) |
Get signature help at a specified Pos
in FileName
.
Definition at line 2305 of file CodeComplete.cpp.
References clang::clangd::ParseInputs::Contents, elog(), clang::clangd::ParseInputs::Index, positionToOffset(), and Preamble.
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 552 of file Quality.cpp.
References encodeFloat().
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 462 of file SourceCode.cpp.
References positionToOffset().
Referenced by findDocumentHighlights(), findImplementations(), findReferences(), getHover(), getSymbolInfo(), locateSymbolAt(), prepareCallHierarchy(), and rename().
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 214 of file SourceCode.cpp.
References lspLength().
Referenced by declToHierarchyItem(), getSemanticRanges(), halfOpenToRange(), clang::clangd::CollectPragmaMarks::PragmaMark(), and clang::clangd::CollectMainFileMacros::SourceRangeSkipped().
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 497 of file SourceCode.cpp.
Referenced by extractUnresolvedNameCheaply(), getSymbolInfo(), and getWorkspaceSymbols().
TokenStream clang::clangd::stripComments | ( | const TokenStream & | Input | ) |
Drops comment tokens.
Definition at line 118 of file Token.cpp.
References clang::clangd::TokenStream::finalize(), clang::clangd::TokenStream::getPayload(), clang::clangd::TokenStream::push(), and clang::clangd::TokenStream::tokens().
std::vector< TypeHierarchyItem > clang::clangd::subTypes | ( | const TypeHierarchyItem & | Item, |
const SymbolIndex * | Index ) |
Returns direct children of a TypeHierarchyItem.
Definition at line 2285 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::data, clang::clangd::URIForFile::file(), fillSubTypes(), subTypes(), clang::clangd::TypeHierarchyItem::ResolveParams::symbolID, and clang::clangd::TypeHierarchyItem::uri.
Referenced by clang::clangd::ClangdServer::subTypes(), and subTypes().
std::optional< std::vector< TypeHierarchyItem > > clang::clangd::superTypes | ( | const TypeHierarchyItem & | Item, |
const SymbolIndex * | Index ) |
Returns direct parents of a TypeHierarchyItem using SymbolIDs stored inside the item.
Definition at line 2264 of file XRefs.cpp.
References clang::clangd::TypeHierarchyItem::data, clang::clangd::URIForFile::file(), clang::clangd::Symbol::ID, clang::clangd::LookupRequest::IDs, clang::clangd::SymbolIndex::lookup(), clang::clangd::TypeHierarchyItem::ResolveParams::parents, superTypes(), symbolToTypeHierarchyItem(), and clang::clangd::TypeHierarchyItem::uri.
Referenced by clang::clangd::ClangdServer::superTypes(), and superTypes().
Symbol clang::clangd::sym | ( | llvm::StringRef | QName, |
index::SymbolKind | Kind, | ||
llvm::StringRef | USRFormat, | ||
llvm::StringRef | Signature ) |
Definition at line 40 of file TestIndex.cpp.
References clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, clang::clangd::Symbol::IndexedForCodeCompletion, clang::clangd::Symbol::Name, clang::clangd::Symbol::Origin, replace(), clang::clangd::Symbol::Scope, clang::clangd::Symbol::Signature, Static, and clang::clangd::Symbol::SymInfo.
Referenced by cls(), conceptSym(), enm(), enmConstant(), func(), macro(), ns(), and var().
Symbol clang::clangd::symbol | ( | llvm::StringRef | QName | ) |
Definition at line 17 of file TestIndex.cpp.
References clang::clangd::Symbol::ID, clang::clangd::Symbol::Name, and clang::clangd::Symbol::Scope.
Referenced by createIndex(), and generateSymbols().
|
static |
Definition at line 1851 of file XRefs.cpp.
References clang::clangd::Symbol::Deprecated, Deprecated, clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, clang::clangd::SymbolID::str(), symbolToCallHierarchyItem(), and symbolToHierarchyItem().
Referenced by incomingCalls(), outgoingCalls(), and symbolToCallHierarchyItem().
|
static |
Definition at line 1820 of file XRefs.cpp.
References elog(), indexSymbolKindToSymbolKind(), clang::clangd::Symbol::Name, clang::clangd::Symbol::Scope, symbolToHierarchyItem(), symbolToLocation(), and clang::clangd::Symbol::SymInfo.
Referenced by symbolToCallHierarchyItem(), symbolToHierarchyItem(), and symbolToTypeHierarchyItem().
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 77 of file FindSymbols.cpp.
References clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::Definition, and indexToLSPLocation().
Referenced by symbolToHierarchyItem().
|
static |
Definition at line 1841 of file XRefs.cpp.
References clang::clangd::Symbol::Deprecated, clang::clangd::Symbol::Flags, clang::clangd::Symbol::ID, symbolToHierarchyItem(), and symbolToTypeHierarchyItem().
Referenced by fillSubTypes(), superTypes(), and symbolToTypeHierarchyItem().
llvm::SmallVector< const NamedDecl *, 1 > clang::clangd::targetDecl | ( | const DynTypedNode & | , |
DeclRelationSet | Mask, | ||
const HeuristicResolver * | Resolver ) |
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 566 of file FindTarget.cpp.
References allTargetDecls().
Referenced by findDocumentHighlights().
clang::clangd::TEST | ( | BackgroundIndex | , |
Profile | ) |
Definition at line 846 of file BackgroundIndexTests.cpp.
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Boost | ) |
Definition at line 738 of file BackgroundIndexTests.cpp.
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Duplicates | ) |
Definition at line 773 of file BackgroundIndexTests.cpp.
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Priority | ) |
Definition at line 706 of file BackgroundIndexTests.cpp.
References clang::clangd::Symbol::Name.
Referenced by TEST().
clang::clangd::TEST | ( | BackgroundQueueTest | , |
Progress | ) |
Definition at line 798 of file BackgroundIndexTests.cpp.
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 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 clang::clangd::Context::derive(), clang::clangd::Context::empty(), and clang::clangd::Context::get().
clang::clangd::TEST | ( | DecisionForestRuntime | , |
Evaluate | ) |
Definition at line 8 of file DecisionForestTests.cpp.
clang::clangd::TEST | ( | PeriodicThrottlerTest | , |
Minimal | ) |
Definition at line 127 of file ThreadingTests.cpp.
References TEST().
clang::clangd::TEST | ( | ProjectAware | , |
CreatedOnce | ) |
Definition at line 54 of file ProjectAwareIndexTests.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, createIndex(), createProjectAwareIndex(), clang::clangd::Config::ExternalIndexSpec::File, clang::clangd::Config::Key, match(), and clang::clangd::FuzzyFindRequest::Query.
clang::clangd::TEST | ( | ProjectAware | , |
Test | ) |
Definition at line 35 of file ProjectAwareIndexTests.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, createIndex(), createProjectAwareIndex(), clang::clangd::Config::ExternalIndexSpec::File, clang::clangd::Config::Key, match(), and clang::clangd::FuzzyFindRequest::Query.
clang::clangd::TEST | ( | SymbolDocumentation | , |
UnhandledDocs | ) |
Definition at line 18 of file SymbolDocumentationTests.cpp.
References clang::clangd::SymbolDocCommentVisitor::docToMarkup().
clang::clangd::TEST_F | ( | BackgroundIndexRebuilderTest | , |
IndexingTUs | ) |
Definition at line 670 of file BackgroundIndexTests.cpp.
References testPath().
clang::clangd::TEST_F | ( | BackgroundIndexRebuilderTest | , |
LoadingShards | ) |
Definition at line 679 of file BackgroundIndexTests.cpp.
References runFuzzyFind(), and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
CmdLineHash | ) |
Definition at line 566 of file BackgroundIndexTests.cpp.
References testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
Config | ) |
Definition at line 113 of file BackgroundIndexTests.cpp.
References clang::clangd::BackgroundIndex::Options::ContextProvider, clang::clangd::Context::current(), clang::clangd::Context::derive(), clang::clangd::MockFS::Files, clang::clangd::CommandMangler::forTests(), clang::clangd::Config::Key, runFuzzyFind(), clang::clangd::Config::Skip, testPath(), and testRoot().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
DirectIncludesTest | ) |
Definition at line 310 of file BackgroundIndexTests.cpp.
References BaseOf.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
IndexTwoFiles | ) |
Definition at line 165 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, runFuzzyFind(), clang::clangd::OverlayCDB::setCompileCommand(), and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
MainFileRefs | ) |
Definition at line 220 of file BackgroundIndexTests.cpp.
References refsAre().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
NoCrashOnErrorFile | ) |
Definition at line 94 of file BackgroundIndexTests.cpp.
References clang::clangd::MockFS::Files, clang::clangd::OverlayCDB::setCompileCommand(), and testPath().
Referenced by TEST_F().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
NoDotsInAbsPath | ) |
Definition at line 477 of file BackgroundIndexTests.cpp.
References testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
Reindex | ) |
Definition at line 594 of file BackgroundIndexTests.cpp.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageEmptyFile | ) |
Definition at line 418 of file BackgroundIndexTests.cpp.
References clang::clangd::OverlayCDB::setCompileCommand(), and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageLoad | ) |
Definition at line 356 of file BackgroundIndexTests.cpp.
References clang::clangd::OverlayCDB::setCompileCommand(), and testPath().
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
ShardStorageTest | ) |
Definition at line 247 of file BackgroundIndexTests.cpp.
clang::clangd::TEST_F | ( | BackgroundIndexTest | , |
UncompilableFiles | ) |
Definition at line 508 of file BackgroundIndexTests.cpp.
References clang::clangd::OverlayCDB::setCompileCommand(), and testPath().
clang::clangd::TEST_F | ( | DirectoryBasedGlobalCompilationDatabaseCacheTest | , |
Cacheable | ) |
Definition at line 519 of file GlobalCompilationDatabaseTests.cpp.
References clang::clangd::MockFS::Files, hasFlag(), testPath(), testRoot(), and clang::clangd::MockFS::Timestamps.
clang::clangd::TEST_F | ( | ThreadingTest | , |
Memoize | ) |
Definition at line 67 of file ThreadingTests.cpp.
References clang::clangd::AsyncTaskRunner::runAsync().
clang::clangd::TEST_F | ( | ThreadingTest | , |
MemoizeDeterministic | ) |
Definition at line 96 of file ThreadingTests.cpp.
References clang::clangd::Memoize< Container >::get(), clang::clangd::Notification::notify(), clang::clangd::AsyncTaskRunner::runAsync(), TEST_F(), clang::clangd::AsyncTaskRunner::wait(), and clang::clangd::Notification::wait().
clang::clangd::TEST_F | ( | ThreadingTest | , |
TaskRunner | ) |
Definition at line 20 of file ThreadingTests.cpp.
References clang::clangd::AsyncTaskRunner::runAsync(), and clang::clangd::AsyncTaskRunner::wait().
std::string clang::clangd::testPath | ( | PathRef | File, |
llvm::sys::path::Style | Style ) |
Definition at line 93 of file TestFS.cpp.
References File, and testRoot().
Referenced by clang::clangd::TweakTest::apply(), clang::clangd::BackgroundIndexRebuilderTest::BackgroundIndexRebuilderTest(), clang::clangd::TestTU::build(), clang::clangd::BackgroundIndexRebuilderTest::checkRebuild(), clang::clangd::TestScheme::getAbsolutePath(), clang::clangd::TestTU::index(), clang::clangd::TestWorkspace::index(), clang::clangd::TestTU::inputs(), clang::clangd::TestTU::preamble(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and clang::clangd::LSPClient::uri().
const char * clang::clangd::testRoot | ( | ) |
Definition at line 85 of file TestFS.cpp.
Referenced by buildTestFS(), clang::clangd::TestScheme::getAbsolutePath(), clang::clangd::TestTU::inputs(), TEST_F(), TEST_F(), testPath(), and clang::clangd::TestScheme::uriFromAbsolutePath().
Deadline clang::clangd::timeoutSeconds | ( | std::optional< double > | Seconds | ) |
Makes a deadline from a timeout in seconds. std::nullopt means wait forever.
Definition at line 113 of file Threading.cpp.
References clang::clangd::Deadline::infinity().
Referenced by clang::clangd::BackgroundQueue::blockUntilIdleForTest(), clang::clangd::ClangdServer::blockUntilIdleForTest(), and clang::clangd::LSPClient::CallResult::take().
Diag clang::clangd::toDiag | ( | const llvm::SMDiagnostic & | D, |
Diag::DiagSource | Source ) |
Definition at line 441 of file Diagnostics.cpp.
References clang::clangd::DiagBase::AbsFile, clang::clangd::DiagBase::InsideMainFile, clang::clangd::DiagBase::Message, clang::clangd::DiagBase::Range, clang::clangd::DiagBase::Severity, and clang::clangd::Diag::Source.
Referenced by clang::clangd::ClangdServer::createConfiguredContextProvider().
std::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 430 of file SourceCode.cpp.
References getTokenFileRange(), getTokenLengthAtLoc(), isValidFileRange(), rangeInCommonFile(), and unionTokenRange().
Referenced by declToHierarchyItem(), and getSemanticRanges().
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 143 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 1002 of file Protocol.cpp.
References clang::clangd::ApplyWorkspaceEditParams::edit.
llvm::json::Value clang::clangd::toJSON | ( | const ASTNode & | N | ) |
Definition at line 1720 of file Protocol.cpp.
References clang::clangd::ASTNode::arcana, clang::clangd::ASTNode::children, clang::clangd::ASTNode::detail, clang::clangd::ASTNode::kind, clang::clangd::ASTNode::range, and clang::clangd::ASTNode::role.
llvm::json::Value clang::clangd::toJSON | ( | const CallHierarchyIncomingCall & | C | ) |
Definition at line 1515 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const CallHierarchyItem & | I | ) |
Definition at line 1481 of file Protocol.cpp.
References clang::clangd::CallHierarchyItem::data, clang::clangd::CallHierarchyItem::detail, clang::clangd::CallHierarchyItem::kind, clang::clangd::CallHierarchyItem::name, clang::clangd::CallHierarchyItem::range, clang::clangd::CallHierarchyItem::selectionRange, clang::clangd::CallHierarchyItem::tags, and clang::clangd::CallHierarchyItem::uri.
llvm::json::Value clang::clangd::toJSON | ( | const CallHierarchyOutgoingCall & | C | ) |
Definition at line 1525 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const ChangeAnnotation & | CA | ) |
Definition at line 212 of file Protocol.cpp.
References clang::clangd::ChangeAnnotation::description, clang::clangd::ChangeAnnotation::label, and clang::clangd::ChangeAnnotation::needsConfirmation.
llvm::json::Value clang::clangd::toJSON | ( | const CodeAction & | CA | ) |
Definition at line 936 of file Protocol.cpp.
References clang::clangd::CodeAction::command, clang::clangd::CodeAction::diagnostics, clang::clangd::CodeAction::edit, clang::clangd::CodeAction::isPreferred, clang::clangd::CodeAction::kind, and clang::clangd::CodeAction::title.
llvm::json::Value clang::clangd::toJSON | ( | const CodeDescription & | D | ) |
Definition at line 729 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const Command & | C | ) |
Definition at line 925 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionItem & | CI | ) |
Definition at line 1157 of file Protocol.cpp.
References clang::clangd::CompletionItem::additionalTextEdits, clang::clangd::CompletionItem::deprecated, clang::clangd::CompletionItem::detail, clang::clangd::CompletionItem::documentation, clang::clangd::CompletionItem::filterText, clang::clangd::CompletionItem::insertText, clang::clangd::CompletionItem::insertTextFormat, clang::clangd::CompletionItem::kind, clang::clangd::CompletionItem::label, clang::clangd::CompletionItem::labelDetails, Missing, clang::clangd::CompletionItem::score, clang::clangd::CompletionItem::sortText, and clang::clangd::CompletionItem::textEdit.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionItemLabelDetails & | CD | ) |
Definition at line 1138 of file Protocol.cpp.
References clang::clangd::CompletionItemLabelDetails::description, and clang::clangd::CompletionItemLabelDetails::detail.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionList & | L | ) |
Definition at line 1196 of file Protocol.cpp.
References clang::clangd::CompletionList::isIncomplete, and clang::clangd::CompletionList::items.
llvm::json::Value clang::clangd::toJSON | ( | const Diagnostic & | D | ) |
Definition at line 733 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const DiagnosticRelatedInformation & | DRI | ) |
Definition at line 720 of file Protocol.cpp.
References clang::clangd::DiagnosticRelatedInformation::location, and clang::clangd::DiagnosticRelatedInformation::message.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentHighlight & | DH | ) |
Definition at line 1270 of file Protocol.cpp.
References clang::clangd::DocumentHighlight::kind, clang::clangd::DocumentHighlight::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const DocumentLink & | DocumentLink | ) |
Definition at line 1670 of file Protocol.cpp.
References clang::clangd::DocumentLink::range, and clang::clangd::DocumentLink::target.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentSymbol & | S | ) |
Definition at line 955 of file Protocol.cpp.
References clang::clangd::DocumentSymbol::children, clang::clangd::DocumentSymbol::deprecated, clang::clangd::DocumentSymbol::detail, clang::clangd::DocumentSymbol::kind, clang::clangd::DocumentSymbol::name, clang::clangd::DocumentSymbol::range, and clang::clangd::DocumentSymbol::selectionRange.
llvm::json::Value clang::clangd::toJSON | ( | const FileStatus & | FStatus | ) |
Definition at line 1277 of file Protocol.cpp.
References clang::clangd::FileStatus::state, and clang::clangd::FileStatus::uri.
llvm::json::Value clang::clangd::toJSON | ( | const FoldingRange & | Range | ) |
Definition at line 1687 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const FuzzyFindRequest & | Request | ) |
Definition at line 45 of file Index.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, clang::clangd::FuzzyFindRequest::Limit, clang::clangd::FuzzyFindRequest::PreferredTypes, clang::clangd::FuzzyFindRequest::ProximityPaths, clang::clangd::FuzzyFindRequest::Query, clang::clangd::FuzzyFindRequest::RestrictForCodeCompletion, and clang::clangd::FuzzyFindRequest::Scopes.
Referenced by operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), toJSON(), toJSON(), toJSON(), toJSON(), toJSON(), toJSON(), toJSON(), and clang::clangd::LSPClient::uri().
llvm::json::Value clang::clangd::toJSON | ( | const Hover & | H | ) |
Definition at line 1082 of file Protocol.cpp.
References clang::clangd::Hover::contents, clang::clangd::Hover::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const InactiveRegionsParams & | InactiveRegions | ) |
Definition at line 1340 of file Protocol.cpp.
References clang::clangd::InactiveRegionsParams::InactiveRegions, and clang::clangd::InactiveRegionsParams::TextDocument.
llvm::json::Value clang::clangd::toJSON | ( | const InlayHint & | H | ) |
Definition at line 1550 of file Protocol.cpp.
References clang::clangd::InlayHint::kind, clang::clangd::InlayHint::label, clang::clangd::InlayHint::paddingLeft, clang::clangd::InlayHint::paddingRight, clang::clangd::InlayHint::position, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const InlayHintKind & | Kind | ) |
Definition at line 1535 of file Protocol.cpp.
References BlockEnd, DefaultArgument, Designator, Parameter, and Type.
llvm::json::Value clang::clangd::toJSON | ( | const InlayHintLabelPart & | L | ) |
Definition at line 1592 of file Protocol.cpp.
References clang::clangd::InlayHintLabelPart::command, clang::clangd::InlayHintLabelPart::location, clang::clangd::InlayHintLabelPart::tooltip, and clang::clangd::InlayHintLabelPart::value.
llvm::json::Value clang::clangd::toJSON | ( | const Location & | P | ) |
Definition at line 154 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const MarkupContent & | MC | ) |
Definition at line 1072 of file Protocol.cpp.
References clang::clangd::MarkupContent::kind, toTextKind(), and clang::clangd::MarkupContent::value.
llvm::json::Value clang::clangd::toJSON | ( | const MemoryTree & | MT | ) |
Keys starting with an underscore(_) represent leaves, e.g.
_total or _self for memory usage of whole subtree or only that specific node in bytes. All other keys represents children. An example: { "_self": 0, "_total": 8, "child1": { "_self": 4, "_total": 4, } "child2": { "_self": 2, "_total": 4, "child_deep": { "_self": 2, "_total": 2, } } }
Definition at line 1701 of file Protocol.cpp.
References clang::clangd::MemoryTree::children(), clang::clangd::MemoryTree::self(), and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const MessageType & | R | ) |
Definition at line 620 of file Protocol.cpp.
|
inline |
Definition at line 317 of file Protocol.h.
llvm::json::Value clang::clangd::toJSON | ( | const OffsetEncoding & | OE | ) |
Definition at line 1632 of file Protocol.cpp.
References toString().
llvm::json::Value clang::clangd::toJSON | ( | const ParameterInformation & | PI | ) |
Definition at line 1203 of file Protocol.cpp.
References clang::clangd::ParameterInformation::documentation, clang::clangd::ParameterInformation::labelOffsets, and clang::clangd::ParameterInformation::labelString.
llvm::json::Value clang::clangd::toJSON | ( | const Position & | P | ) |
Definition at line 127 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const PrepareRenameResult & | PRR | ) |
Definition at line 1261 of file Protocol.cpp.
References clang::clangd::PrepareRenameResult::placeholder, clang::clangd::PrepareRenameResult::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const ProgressParams< T > & | P | ) |
Definition at line 662 of file Protocol.h.
llvm::json::Value clang::clangd::toJSON | ( | const PublishDiagnosticsParams & | PDP | ) |
Definition at line 773 of file Protocol.cpp.
References clang::clangd::PublishDiagnosticsParams::diagnostics, clang::clangd::PublishDiagnosticsParams::uri, and clang::clangd::PublishDiagnosticsParams::version.
llvm::json::Value clang::clangd::toJSON | ( | const Range & | P | ) |
Definition at line 143 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const ReferenceLocation & | P | ) |
Definition at line 165 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const RenameParams & | R | ) |
Definition at line 1253 of file Protocol.cpp.
References clang::clangd::RenameParams::newName, clang::clangd::RenameParams::position, and clang::clangd::RenameParams::textDocument.
llvm::json::Value clang::clangd::toJSON | ( | const SelectionRange & | Out | ) |
Definition at line 1656 of file Protocol.cpp.
References clang::clangd::SelectionRange::parent, clang::clangd::SelectionRange::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokens & | Tokens | ) |
Definition at line 1306 of file Protocol.cpp.
References encodeTokens(), clang::clangd::SemanticTokens::resultId, and clang::clangd::SemanticTokens::tokens.
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokensEdit & | Edit | ) |
Definition at line 1311 of file Protocol.cpp.
References encodeTokens(), and SemanticTokenEncodingSize.
llvm::json::Value clang::clangd::toJSON | ( | const SemanticTokensOrDelta & | TE | ) |
Definition at line 1318 of file Protocol.cpp.
References clang::clangd::SemanticTokensOrDelta::edits, encodeTokens(), clang::clangd::SemanticTokensOrDelta::resultId, and clang::clangd::SemanticTokensOrDelta::tokens.
llvm::json::Value clang::clangd::toJSON | ( | const ShowMessageParams & | R | ) |
Definition at line 624 of file Protocol.cpp.
References clang::clangd::ShowMessageParams::message, and clang::clangd::ShowMessageParams::type.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureHelp & | SH | ) |
Definition at line 1234 of file Protocol.cpp.
References clang::clangd::SignatureHelp::activeParameter, clang::clangd::SignatureHelp::activeSignature, and clang::clangd::SignatureHelp::signatures.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureInformation & | SI | ) |
Definition at line 1217 of file Protocol.cpp.
References clang::clangd::SignatureInformation::documentation, clang::clangd::SignatureInformation::label, clang::clangd::SignatureInformation::parameters, and clang::clangd::MarkupContent::value.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolDetails & | P | ) |
Definition at line 878 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolID & | S | ) |
Definition at line 1765 of file Protocol.cpp.
References clang::clangd::SymbolID::str().
llvm::json::Value clang::clangd::toJSON | ( | const SymbolInformation & | P | ) |
Definition at line 853 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TextDocumentEdit & | P | ) |
Definition at line 226 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TextDocumentIdentifier & | R | ) |
Definition at line 98 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
llvm::json::Value clang::clangd::toJSON | ( | const TextEdit & | P | ) |
Definition at line 195 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TweakArgs & | A | ) |
Definition at line 997 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const TypeHierarchyItem & | I | ) |
Definition at line 1429 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::data, clang::clangd::TypeHierarchyItem::detail, clang::clangd::TypeHierarchyItem::kind, clang::clangd::TypeHierarchyItem::name, clang::clangd::TypeHierarchyItem::range, clang::clangd::TypeHierarchyItem::selectionRange, and clang::clangd::TypeHierarchyItem::uri.
llvm::json::Value clang::clangd::toJSON | ( | const TypeHierarchyItem::ResolveParams & | RP | ) |
Definition at line 1416 of file Protocol.cpp.
References clang::clangd::TypeHierarchyItem::ResolveParams::parents, and clang::clangd::TypeHierarchyItem::ResolveParams::symbolID.
llvm::json::Value clang::clangd::toJSON | ( | const URIForFile & | U | ) |
Serialize/deserialize URIForFile
to/from a string URI.
Definition at line 92 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
llvm::json::Value clang::clangd::toJSON | ( | const VersionedTextDocumentIdentifier & | R | ) |
Definition at line 108 of file Protocol.cpp.
References toJSON(), and clang::clangd::VersionedTextDocumentIdentifier::version.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressBegin & | P | ) |
Definition at line 586 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressCreateParams & | P | ) |
Definition at line 582 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressEnd & | P | ) |
Definition at line 612 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkDoneProgressReport & | P | ) |
Definition at line 600 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | const WorkspaceEdit & | WE | ) |
Definition at line 971 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changeAnnotations, clang::clangd::WorkspaceEdit::changes, and clang::clangd::WorkspaceEdit::documentChanges.
llvm::json::Value clang::clangd::toJSON | ( | DiagnosticTag | Tag | ) |
Definition at line 727 of file Protocol.cpp.
llvm::json::Value clang::clangd::toJSON | ( | SymbolTag | Tag | ) |
Definition at line 1477 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 >)> | OutFn ) |
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 467 of file Diagnostics.cpp.
References clang::clangd::DiagBase::AbsFile, clang::clangd::URIForFile::canonicalize(), clang::clangd::Diagnostic::category, clang::clangd::Diag::Clang, clang::clangd::Diag::Clangd, clang::clangd::Diag::ClangdConfig, clang::clangd::Diag::ClangTidy, clang::clangd::Diagnostic::code, clang::clangd::Diagnostic::codeDescription, clang::clangd::Diagnostic::data, Deprecated, clang::clangd::ClangdDiagnosticOptions::EmitRelatedLocations, File, getDiagnosticDocURI(), getSeverity(), clang::clangd::DiagBase::InsideMainFile, clang::clangd::DiagnosticRelatedInformation::location, clang::clangd::Diagnostic::message, clang::clangd::DiagnosticRelatedInformation::message, clang::clangd::DiagBase::Range, clang::clangd::Diagnostic::range, clang::clangd::Location::range, clang::clangd::Diagnostic::relatedInformation, clang::clangd::ClangdDiagnosticOptions::SendDiagnosticCategory, clang::clangd::DiagBase::Severity, clang::clangd::Diagnostic::severity, clang::clangd::Diagnostic::source, clang::clangd::Diagnostic::tags, clang::clangd::Diag::Unknown, clang::clangd::Location::uri, and vlog().
|
static |
Definition at line 48 of file Annotations.cpp.
References clang::clangd::Range::end, offsetToPosition(), and clang::clangd::Range::start.
Referenced by clang::clangd::Annotations::ranges(), clang::clangd::Annotations::rangesWithPayload(), and clang::clangd::Annotations::rangeWithPayload().
llvm::StringRef clang::clangd::toSemanticTokenModifier | ( | HighlightingModifier | Modifier | ) |
Definition at line 1466 of file SemanticHighlighting.cpp.
References Abstract, ClassScope, ConstructorOrDestructor, Declaration, Deduced, DefaultLibrary, Definition, DependentName, Deprecated, FileScope, FunctionScope, GlobalScope, Modifier, Readonly, Static, UsedAsMutablePointer, UsedAsMutableReference, UserDefined, and Virtual.
Referenced by operator<<(), and semanticTokenModifiers().
std::vector< SemanticToken > clang::clangd::toSemanticTokens | ( | llvm::ArrayRef< HighlightingToken > | Tokens, |
llvm::StringRef | Code ) |
Definition at line 1346 of file SemanticHighlighting.cpp.
References clang::clangd::Position::character, clang::clangd::SemanticToken::deltaLine, clang::clangd::SemanticToken::deltaStart, clang::clangd::Range::end, clang::clangd::SemanticToken::length, clang::clangd::Position::line, positionToOffset(), clang::clangd::HighlightingToken::R, clang::clangd::Range::start, clang::clangd::SemanticToken::tokenModifiers, and clang::clangd::SemanticToken::tokenType.
llvm::StringRef clang::clangd::toSemanticTokenType | ( | HighlightingKind | Kind | ) |
Definition at line 1412 of file SemanticHighlighting.cpp.
References Bracket, Class, Concept, Enum, EnumConstant, Field, Function, InactiveCode, Interface, Label, LocalVariable, Macro, Method, Modifier, Namespace, Operator, Parameter, Primitive, StaticField, StaticMethod, TemplateParameter, Type, Typedef, Unknown, and Variable.
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 452 of file SourceCode.cpp.
References isValidFileRange().
Referenced by getSpelledSpecifier(), and clang::clangd::SymbolCollector::handleMacros().
|
static |
Definition at line 1619 of file Protocol.cpp.
References UnsupportedEncoding, UTF16, UTF32, and UTF8.
Referenced by clang::clangd::ParsedAST::build(), clang::clangd::ModulesBuilder::buildPrerequisiteModulesFor(), operator<<(), toJSON(), clang::clangd::FileIndex::updateMain(), and xpcToJson().
TextEdit clang::clangd::toTextEdit | ( | const FixItHint & | FixIt, |
const SourceManager & | M, | ||
const LangOptions & | L ) |
Definition at line 556 of file SourceCode.cpp.
References halfOpenToRange(), clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
Referenced by clang::clangd::StoreDiags::HandleDiagnostic().
|
static |
Definition at line 1041 of file Protocol.cpp.
References Markdown, and PlainText.
Referenced by operator<<(), and toJSON().
|
static |
Definition at line 318 of file SourceCode.cpp.
References getLocForTokenBegin().
Referenced by getExpansionTokenRangeInSameFile(), and rangeInCommonFile().
std::string clang::clangd::toYAML | ( | const Ref & | R | ) |
Definition at line 557 of file YAMLSerialization.cpp.
References Reference.
std::string clang::clangd::toYAML | ( | const Relation & | R | ) |
Definition at line 546 of file YAMLSerialization.cpp.
Definition at line 535 of file YAMLSerialization.cpp.
std::string clang::clangd::toYAML | ( | const Symbol & | S | ) |
Definition at line 524 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 383 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 1244 of file SourceCode.cpp.
References clang::clangd::PreamblePatch::HeaderName.
Referenced by clang::clangd::StoreDiags::HandleDiagnostic(), clang::clangd::IncludeStructure::RecordHeaders::InclusionDirective(), and locateMacroAt().
|
static |
Definition at line 1968 of file XRefs.cpp.
References clang::clangd::SelectionTree::Node::ASTNode, Deduced, clang::clangd::SelectionTree::Node::getDeclContext(), getDeducedType(), clang::clangd::SelectionTree::Node::Parent, Type, and typeForNode().
Referenced by findType(), and typeForNode().
std::vector< const CXXRecordDecl * > clang::clangd::typeParents | ( | const CXXRecordDecl * | CXXRD | ) |
Given a record type declaration, find its base (parent) types.
Definition at line 2178 of file XRefs.cpp.
References Type, and typeParents().
Referenced by fillSuperTypes(), and typeParents().
Definition at line 480 of file SourceCode.cpp.
|
static |
Definition at line 327 of file SourceCode.cpp.
References getLocForTokenEnd().
Referenced by getTokenFileRange(), and toHalfOpenFileRange().
|
static |
Definition at line 2137 of file XRefs.cpp.
References unwrapFindType().
|
static |
Definition at line 2097 of file XRefs.cpp.
References unwrapFindType().
Referenced by findType(), unwrapFindType(), and unwrapFindType().
|
static |
Definition at line 62 of file DraftStore.cpp.
References increment(), and log().
Referenced by clang::clangd::DraftStore::addDraft().
Symbol clang::clangd::var | ( | llvm::StringRef | Name | ) |
Definition at line 78 of file TestIndex.cpp.
References sym().
std::string clang::clangd::versionString | ( | ) |
Definition at line 18 of file Feature.cpp.
Referenced by clangdMain().
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 823 of file SourceCode.cpp.
Referenced by locateSymbolTextually().
Invokes Callback with each StringRef& contained in the Symbol.
Useful for deduplicating backing strings.
Definition at line 171 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 72 of file Logger.h.
References clang::clangd::detail::log(), and clang::clangd::Logger::Verbose.
Referenced by clangdMain(), clang::clangd::ClangdServer::codeComplete(), clang::clangd::config::Fragment::compile(), clang::clangd::ClangdServer::createConfiguredContextProvider(), findNearbyIdentifier(), formatIncremental(), clang::clangd::dex::Dex::fuzzyFind(), getMappedRanges(), loadIndex(), locateSymbolAt(), locateSymbolTextually(), clang::clangd::IgnoreDiagnostics::log(), logBody(), main(), toLSPDiags(), clang::clangd::FileIndex::updateMain(), and clang::clangd::FileIndex::updatePreamble().
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 121 of file Threading.cpp.
References clang::clangd::Deadline::infinity(), and clang::clangd::Deadline::zero().
Referenced by clang::clangd::DirectoryBasedGlobalCompilationDatabase::BroadcastThread::blockUntilIdle(), clang::clangd::BackgroundQueue::blockUntilIdleForTest(), clang::clangd::LSPClient::CallResult::take(), clang::clangd::AsyncTaskRunner::wait(), clang::clangd::Notification::wait(), and wait().
|
nodiscard |
Waits on a condition variable until F() is true or D expires.
Definition at line 80 of file Threading.h.
References wait().
|
static |
Definition at line 376 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::calculateDerivedSignals(), 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 649 of file Diagnostics.cpp.
Referenced by clang::clangd::StoreDiags::HandleDiagnostic().
void clang::clangd::writeYAML | ( | const IndexFileOut & | O, |
llvm::raw_ostream & | OS ) |
Definition at line 440 of file YAMLSerialization.cpp.
References clang::clangd::IndexFileOut::Cmd, clang::clangd::IndexFileOut::Refs, clang::clangd::IndexFileOut::Relations, clang::clangd::IndexFileOut::Sources, and clang::clangd::IndexFileOut::Symbols.
Referenced by operator<<().
|
static |
Referenced by clangdMain().
llvm::json::Value clang::clangd::xpcToJson | ( | const xpc_object_t & | XPCObject | ) |
Definition at line 26 of file Conversion.cpp.
References elog(), and toString().
Referenced by dumpXPCObject().
|
static |
Definition at line 43 of file Compiler.cpp.
Referenced by allowCrashPragmasForTest(), and disableUnsupportedOptions().
|
staticconstexpr |
Definition at line 72 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::FuzzyMatcher(), and isAwful().
|
staticconstexpr |
Definition at line 20 of file FileCache.cpp.
Referenced by clang::clangd::FileCache::FileCache(), and clang::clangd::FileCache::read().
|
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 370 of file Protocol.h.
|
constexpr |
|
static |
Definition at line 15 of file ThreadCrashReporter.cpp.
Referenced by clang::clangd::ThreadCrashReporter::runCrashHandlers(), clang::clangd::ThreadCrashReporter::ThreadCrashReporter(), and clang::clangd::ThreadCrashReporter::~ThreadCrashReporter().
|
static |
Definition at line 139 of file TUScheduler.cpp.
Referenced by clang::clangd::TUScheduler::getFileBeingProcessedInContext(), and clang::clangd::TUScheduler::runWithPreamble().
|
staticconstexpr |
Definition at line 23 of file FileCache.cpp.
Referenced by clang::clangd::FileCache::read().
Key< OffsetEncoding > clang::clangd::kCurrentOffsetEncoding |
Definition at line 142 of file SourceCode.cpp.
Referenced by digest(), and lspEncoding().
clang::clangd::MaxBackticks = std::max(Backticks, MaxBackticks) |
Definition at line 288 of file Markup.cpp.
|
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 693 of file CanonicalIncludes.cpp.
Referenced by clang::clangd::CanonicalIncludes::mapHeader().
|
staticconstexpr |
Definition at line 74 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::FuzzyMatcher(), and clang::clangd::FuzzyMatcher::match().
|
static |
Definition at line 16 of file BackgroundQueue.cpp.
Referenced by clang::clangd::BackgroundQueue::preventThreadStarvationInTests(), and clang::clangd::BackgroundQueue::work().
|
constexpr |
Definition at line 1284 of file Protocol.cpp.
Referenced by encodeTokens(), and toJSON().
|
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 410 of file Protocol.h.
|
constexpr |
Definition at line 409 of file Protocol.h.
Referenced by adjustKindToCapability().
|
static |
Definition at line 36 of file QualityTests.cpp.
|
static |
Definition at line 19 of file URITests.cpp.
volatile int clang::clangd::UnittestSchemeAnchorSource = 0 |
Definition at line 137 of file TestFS.cpp.