clang-tools
8.0.0
|
Namespaces | |
detail | |
dex | |
riff | |
trace | |
Classes | |
struct | ApplyWorkspaceEditParams |
struct | ASTRetentionPolicy |
Configuration of the AST retention policy. More... | |
class | AsyncTaskRunner |
Runs tasks on separate (detached) threads and wait for all tasks to finish. More... | |
class | BackgroundIndex |
class | BackgroundIndexStorage |
class | CancelledError |
Conventional error when no result is returned due to cancellation. More... | |
class | CanonicalIncludes |
Maps a definition location onto an #include file, based on a set of filename rules. More... | |
struct | ClangdCompileCommand |
Clangd extension that's used in the 'compilationDatabaseChanges' in workspace/didChangeConfiguration to record updates to the in-memory compilation database. More... | |
struct | ClangdDiagnosticOptions |
class | ClangdLSPServer |
This class exposes ClangdServer's capabilities via Language Server Protocol. More... | |
class | ClangdServer |
Manages a collection of source files and derived data (ASTs, indexes), and provides language-aware features such as code completion. More... | |
struct | ClientCapabilities |
struct | CodeAction |
A code action represents a change that can be performed in code, e.g. More... | |
struct | CodeActionContext |
struct | CodeActionParams |
struct | CodeCompleteOptions |
struct | CodeCompleteResult |
struct | CodeCompletion |
struct | Command |
struct | CompletionContext |
struct | CompletionItem |
struct | CompletionList |
Represents a collection of completion items to be presented in the editor. More... | |
struct | CompletionParams |
struct | ConfigurationSettings |
Clangd extension: parameters configurable at any time, via the workspace/didChangeConfiguration notification. More... | |
class | Context |
A context is an immutable container for per-request data that must be propagated through layers that don't care about it. More... | |
class | Deadline |
A point in time we can wait for. More... | |
struct | Diag |
A top-level diagnostic that may have Notes and Fixes. More... | |
struct | DiagBase |
Contains basic information about a diagnostic. More... | |
struct | Diagnostic |
class | DiagnosticsConsumer |
struct | DidChangeConfigurationParams |
struct | DidChangeTextDocumentParams |
struct | DidChangeWatchedFilesParams |
struct | DidCloseTextDocumentParams |
struct | DidOpenTextDocumentParams |
class | DirectoryBasedGlobalCompilationDatabase |
Gets compile args from tooling::CompilationDatabases built for parent directories. More... | |
struct | DocumentFormattingParams |
struct | DocumentHighlight |
A document highlight is a range inside a text document which deserves special attention. More... | |
struct | DocumentOnTypeFormattingParams |
struct | DocumentRangeFormattingParams |
struct | DocumentSymbol |
Represents programming constructs like variables, classes, interfaces etc. More... | |
struct | DocumentSymbolParams |
class | DraftStore |
A thread-safe container for files opened in a workspace, addressed by filenames. More... | |
class | Event |
An Event<T> allows events of type T to be broadcast to listeners. More... | |
struct | ExecuteCommandParams |
Exact commands are not specified in the protocol so we define the ones supported by Clangd here. More... | |
class | FileDistance |
struct | FileDistanceOptions |
struct | FileEvent |
class | FileIndex |
This manages symbols from files and an in-memory index on all symbols. More... | |
struct | 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 Symbols from several source files. More... | |
class | FileSystemProvider |
struct | Fix |
Represents a single fix-it that editor can apply to fix the error. More... | |
struct | FormattingOptions |
struct | ForwardBinder |
Stores a callable object (Func) and arguments (Args) and allows to call the callable with provided arguments later using operator () . More... | |
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 | Hover |
class | IgnoreDiagnostics |
struct | IncludeGraphNode |
class | IncludeInserter |
class | IncludeStructure |
struct | Inclusion |
struct | IndexFileIn |
struct | IndexFileOut |
struct | InitializationOptions |
Clangd extension: parameters configurable at initialize time. More... | |
struct | InitializeParams |
struct | InputsAndAST |
struct | InputsAndPreamble |
class | Key |
Values in a Context are indexed by typed keys. More... | |
struct | 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 |
struct | LSPDiagnosticCompare |
A LSP-specific comparator used to find diagnostic in a container like std:map. More... | |
class | LSPError |
struct | MarkupContent |
class | MemIndex |
MemIndex is a naive in-memory index suitable for a small set of symbols. More... | |
class | MergedIndex |
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... | |
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... | |
class | ParsingCallbacks |
struct | Position |
struct | PreambleData |
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... | |
struct | ProjectInfo |
struct | Range |
class | RealFileSystemProvider |
struct | Ref |
struct | ReferenceParams |
class | RefSlab |
struct | RefsRequest |
struct | RenameParams |
class | ScopeDistance |
Support lookups like FileDistance, but the lookup keys are symbol scopes. More... | |
class | Semaphore |
Limits the number of threads that can acquire the lock at the same time. More... | |
struct | SignatureHelp |
Represents the signature of a callable. More... | |
struct | SignatureInformation |
Represents the signature of something callable. More... | |
struct | SignatureQualitySignals |
struct | SourceParams |
struct | SpeculativeFuzzyFind |
A speculative and asynchronous fuzzy find index request (based on cached request) that can be sent before parsing sema. More... | |
class | StoreDiags |
StoreDiags collects the diagnostics that can later be reported by clangd. More... | |
class | StreamLogger |
class | SwapIndex |
struct | Symbol |
class | SymbolCollector |
Collect declarations (symbols) from an AST. More... | |
struct | SymbolDetails |
Represents information about identifier. More... | |
class | SymbolID |
class | SymbolIndex |
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbols based on names or unique IDs. More... | |
struct | SymbolInformation |
Represents information about programming constructs like variables, classes, interfaces etc. More... | |
struct | SymbolLocation |
struct | SymbolQualitySignals |
Attributes of a symbol that affect how much we like it. More... | |
struct | SymbolRelevanceSignals |
Attributes of a symbol-query pair that affect how much we like it. More... | |
class | SymbolSlab |
struct | TextDocumentContentChangeEvent |
struct | TextDocumentIdentifier |
struct | TextDocumentItem |
struct | TextDocumentPositionParams |
struct | TextEdit |
class | TopN |
TopN<T> is a lossy container that preserves only the "best" N elements. More... | |
class | Transport |
struct | TUAction |
class | TUScheduler |
Handles running tasks for ClangdServer and managing the resources (e.g., preambles and ASTs) for opened files. More... | |
struct | TUStatus |
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... | |
class | WithContext |
WithContext replaces Context::current() with a provided scope. More... | |
class | WithContextValue |
WithContextValue extends Context::current() with a single value. More... | |
struct | WorkspaceEdit |
struct | WorkspaceSymbolParams |
The parameters of a Workspace Symbol Request. More... | |
Typedefs | |
using | Canceler = std::function< void()> |
A canceller requests cancellation of a task, when called. More... | |
using | PreambleParsedCallback = std::function< void(ASTContext &, std::shared_ptr< clang::Preprocessor >)> |
template<typename T > | |
using | Callback = llvm::unique_function< void(llvm::Expected< T >)> |
A Callback<T> is a void function that accepts Expected<T>. More... | |
using | CharTypeSet = unsigned char |
using | IncludeGraph = llvm::StringMap< IncludeGraphNode > |
using | Path = std::string |
A typedef to represent a file path. More... | |
using | PathRef = llvm::StringRef |
A typedef to represent a ref to file path. More... | |
using | ShutdownParams = NoParams |
using | ExitParams = NoParams |
using | CompletionItemKindBitset = std::bitset< CompletionItemKindMax+1 > |
using | SymbolKindBitset = std::bitset< SymbolKindMax+1 > |
using | FileDigest = decltype(llvm::SHA1::hash({})) |
typedef llvm::Registry< URIScheme > | URISchemeRegistry |
By default, a "file" scheme is supported where URI paths are always absolute in the file system. More... | |
Functions | |
bool | isSpelledInSourceCode (const Decl *D) |
bool | isImplementationDetail (const Decl *D) |
Returns true if the declaration is considered implementation detail based on heuristics. More... | |
SourceLocation | findNameLoc (const clang::Decl *D) |
Find the identifier source location of the given D. More... | |
std::string | printQualifiedName (const NamedDecl &ND) |
Returns the qualified name of ND. More... | |
static const TemplateArgumentList * | getTemplateSpecializationArgs (const NamedDecl &ND) |
std::string | printName (const ASTContext &Ctx, const NamedDecl &ND) |
Prints unqualified name of the decl for the purpose of displaying it to the user. More... | |
std::string | printNamespaceScope (const DeclContext &DC) |
Returns the first enclosing namespace scope starting from DC . More... | |
llvm::Optional< SymbolID > | getSymbolID (const Decl *D) |
Gets the symbol ID for a declaration, if possible. More... | |
llvm::Optional< SymbolID > | getSymbolID (const IdentifierInfo &II, const MacroInfo *MI, const SourceManager &SM) |
Gets the symbol ID for a macro, if possible. More... | |
std::pair< Context, Canceler > | cancelableTask () |
Defines a new task whose cancellation may be requested. More... | |
bool | isCancelled (const Context &Ctx=Context::current()) |
True if the current context is within a cancelable task which was cancelled. More... | |
static std::vector< SymbolInformation > | flattenSymbolHierarchy (llvm::ArrayRef< DocumentSymbol > Symbols, const URIForFile &FileURI) |
The functions constructs a flattened view of the DocumentSymbol hierarchy. More... | |
static llvm::Optional< Command > | asCommand (const CodeAction &Action) |
void | dumpAST (ParsedAST &AST, llvm::raw_ostream &OS) |
For testing/debugging purposes. More... | |
std::unique_ptr< CompilerInvocation > | buildCompilerInvocation (const ParseInputs &Inputs) |
Builds compiler invocation that could be used to build AST or preamble. More... | |
std::shared_ptr< const PreambleData > | buildPreamble (PathRef FileName, CompilerInvocation &CI, std::shared_ptr< const PreambleData > OldPreamble, const tooling::CompileCommand &OldCompileCommand, const ParseInputs &Inputs, std::shared_ptr< PCHContainerOperations > PCHs, bool StoreInMemory, PreambleParsedCallback PreambleCallback) |
Rebuild the preamble for the new inputs unless the old one can be reused. More... | |
llvm::Optional< ParsedAST > | buildAST (PathRef FileName, std::unique_ptr< CompilerInvocation > Invocation, const ParseInputs &Inputs, std::shared_ptr< const PreambleData > Preamble, std::shared_ptr< PCHContainerOperations > PCHs) |
Build an AST from provided user inputs. More... | |
SourceLocation | getBeginningOfIdentifier (ParsedAST &Unit, const Position &Pos, const FileID FID) |
Get the beginning SourceLocation at a specified Pos . More... | |
llvm::Expected< llvm::StringRef > | speculateCompletionFilter (llvm::StringRef Content, Position Pos) |
Retrives a speculative code completion filter text before the cursor. More... | |
CodeCompleteResult | codeComplete (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind) |
SignatureHelp | signatureHelp (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, const SymbolIndex *Index) |
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) |
raw_ostream & | operator<< (raw_ostream &, const CodeCompletion &) |
raw_ostream & | operator<< (raw_ostream &, const CodeCompleteResult &) |
CodeCompleteResult | codeComplete (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, StringRef Contents, Position Pos, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind=nullptr) |
Get code completions at a specified Pos in FileName . More... | |
SignatureHelp | signatureHelp (PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, StringRef Contents, Position Pos, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, const SymbolIndex *Index) |
Get signature help at a specified Pos in FileName . More... | |
std::string | getDocComment (const ASTContext &Ctx, const CodeCompletionResult &Result, bool CommentsFromHeaders) |
Gets a minimally formatted documentation comment of Result , with comment markers stripped. More... | |
std::string | getDeclComment (const ASTContext &Ctx, const NamedDecl &D) |
Similar to getDocComment, but returns the comment for a NamedDecl. More... | |
void | getSignature (const CodeCompletionString &CCS, std::string *Signature, std::string *Snippet, std::string *RequiredQualifiers=nullptr) |
Formats the signature for an item, as a display string and snippet. More... | |
std::string | formatDocumentation (const CodeCompletionString &CCS, llvm::StringRef DocComment) |
Assembles formatted documentation for a completion result. More... | |
std::string | getReturnType (const CodeCompletionString &CCS) |
Gets detail to be used as the detail field in an LSP completion item. More... | |
std::unique_ptr< CompilerInstance > | prepareCompilerInstance (std::unique_ptr< clang::CompilerInvocation > CI, const PrecompiledPreamble *Preamble, std::unique_ptr< llvm::MemoryBuffer > Buffer, std::shared_ptr< PCHContainerOperations > PCHs, 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, std::shared_ptr< PCHContainerOperations >, IntrusiveRefCntPtr< llvm::vfs::FileSystem >, DiagnosticConsumer &) |
Creates a compiler instance, configured so that: More... | |
static Context & | currentContext () |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const DiagBase &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Fix &F) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diag &D) |
CodeAction | toCodeAction (const Fix &D, const URIForFile &File) |
Convert from Fix to LSP CodeAction. More... | |
void | toLSPDiags (const Diag &D, const URIForFile &File, const ClangdDiagnosticOptions &Opts, llvm::function_ref< void(clangd::Diagnostic, llvm::ArrayRef< Fix >)> OutFn) |
Conversion to LSP diagnostics. More... | |
int | getSeverity (DiagnosticsEngine::Level L) |
Convert from clang diagnostic level to LSP severity. More... | |
static 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< std::vector< SymbolInformation > > | getWorkspaceSymbols (llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath) |
Searches for the symbols matching Query . More... | |
llvm::Expected< std::vector< DocumentSymbol > > | getDocumentSymbols (ParsedAST &AST) |
Retrieves the symbols contained in the "main file" section of an AST in the same order that they appear. More... | |
template<class Func , class... Args> | |
ForwardBinder< Func, Args... > | Bind (Func F, Args &&... As) |
Creates an object that stores a callable (F ) and first arguments to the callable (As ) and allows to call F with at a later point. More... | |
static char | lower (char C) |
static bool | isAwful (int S) |
template<typename T > | |
static T | packedLookup (const uint8_t *Data, int I) |
CharTypeSet | calculateRoles (llvm::StringRef Text, llvm::MutableArrayRef< CharRole > Roles) |
static std::string | getFallbackClangPath () |
bool | isLiteralInclude (llvm::StringRef Include) |
Returns true if Include is literal include like "path" or <path>. More... | |
std::unique_ptr< PPCallbacks > | collectIncludeStructureCallback (const SourceManager &SM, IncludeStructure *Out) |
Returns a PPCallback that visits all inclusions in the main file. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Inclusion &Inc) |
std::unique_ptr< CommentHandler > | collectIWYUHeaderMaps (CanonicalIncludes *Includes) |
Returns a CommentHandler that parses pragma comment on include files to determine when we should include a different header from the header that directly defines a symbol. More... | |
void | addSystemHeadersMapping (CanonicalIncludes *Includes) |
Adds mapping for system headers and some special symbols (e.g. More... | |
static std::pair< SymbolSlab, RefSlab > | indexSymbols (ASTContext &AST, std::shared_ptr< Preprocessor > PP, llvm::ArrayRef< Decl *> DeclsToIndex, bool IsIndexMainAST) |
std::pair< SymbolSlab, RefSlab > | indexMainDecls (ParsedAST &AST) |
Retrieves symbols and refs of local top level decls in AST (i.e. More... | |
SymbolSlab | indexHeaderSymbols (ASTContext &AST, std::shared_ptr< Preprocessor > PP) |
Idex declarations from AST and macros from PP that are declared in included headers. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolLocation &L) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, SymbolOrigin O) |
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) |
static void | own (Symbol &S, llvm::UniqueStringSaver &Strings) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, RefKind K) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Ref &R) |
bool | fromJSON (const llvm::json::Value &Parameters, FuzzyFindRequest &Request) |
llvm::json::Value | toJSON (const FuzzyFindRequest &Request) |
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) |
SymbolOrigin | operator| (SymbolOrigin A, SymbolOrigin B) |
SymbolOrigin & | operator|= (SymbolOrigin &A, SymbolOrigin B) |
SymbolOrigin | operator & (SymbolOrigin A, SymbolOrigin B) |
raw_ostream & | operator<< (raw_ostream &, SymbolOrigin) |
Symbol::SymbolFlag | operator| (Symbol::SymbolFlag A, Symbol::SymbolFlag B) |
Symbol::SymbolFlag & | operator|= (Symbol::SymbolFlag &A, Symbol::SymbolFlag B) |
raw_ostream & | operator<< (raw_ostream &, Symbol::SymbolFlag) |
template<typename Callback > | |
void | visitStrings (Symbol &S, const Callback &CB) |
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) |
std::unique_ptr< FrontendAction > | createStaticIndexingAction (SymbolCollector::Options Opts, std::function< void(SymbolSlab)> SymbolsCallback, std::function< void(RefSlab)> RefsCallback, std::function< void(IncludeGraph)> IncludeGraphCallback) |
Symbol | mergeSymbol (const Symbol &L, const Symbol &R) |
void | writeYAML (const IndexFileOut &, llvm::raw_ostream &) |
llvm::Expected< IndexFileIn > | readYAML (llvm::StringRef) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const IndexFileOut &O) |
llvm::Expected< IndexFileIn > | readIndexFile (llvm::StringRef Data) |
std::unique_ptr< SymbolIndex > | loadIndex (llvm::StringRef SymbolFilename, bool UseDex) |
std::string | toYAML (const Symbol &) |
std::string | toYAML (const std::pair< SymbolID, ArrayRef< Ref >> &) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolID &ID) |
llvm::hash_code | hash_value (const SymbolID &ID) |
std::string | toYAML (const std::pair< SymbolID, llvm::ArrayRef< Ref >> &Data) |
std::unique_ptr< Transport > | newJSONTransport (std::FILE *In, llvm::raw_ostream &Out, llvm::raw_ostream *InMirror, bool Pretty, JSONStreamStyle Style) |
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) |
bool | fromJSON (const llvm::json::Value &E, URIForFile &R) |
llvm::json::Value | toJSON (const URIForFile &U) |
Serialize/deserialize URIForFile to/from a string URI. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const URIForFile &U) |
llvm::json::Value | toJSON (const TextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentIdentifier &R) |
bool | fromJSON (const llvm::json::Value &Params, Position &R) |
llvm::json::Value | toJSON (const Position &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Position &P) |
bool | fromJSON (const llvm::json::Value &Params, Range &R) |
llvm::json::Value | toJSON (const Range &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Range &R) |
llvm::json::Value | toJSON (const Location &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Location &L) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentItem &R) |
bool | fromJSON (const llvm::json::Value &Params, TextEdit &R) |
llvm::json::Value | toJSON (const TextEdit &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const TextEdit &TE) |
bool | fromJSON (const llvm::json::Value &E, TraceLevel &Out) |
bool | fromJSON (const llvm::json::Value &E, SymbolKind &Out) |
bool | fromJSON (const llvm::json::Value &E, SymbolKindBitset &Out) |
SymbolKind | adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds) |
bool | fromJSON (const llvm::json::Value &Params, ClientCapabilities &R) |
bool | fromJSON (const llvm::json::Value &Params, InitializeParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidOpenTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidCloseTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeTextDocumentParams &R) |
bool | fromJSON (const llvm::json::Value &E, FileChangeType &Out) |
bool | fromJSON (const llvm::json::Value &Params, FileEvent &R) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeWatchedFilesParams &R) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentContentChangeEvent &R) |
bool | fromJSON (const llvm::json::Value &Params, FormattingOptions &R) |
llvm::json::Value | toJSON (const FormattingOptions &P) |
bool | fromJSON (const llvm::json::Value &Params, DocumentRangeFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentOnTypeFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentFormattingParams &R) |
bool | fromJSON (const llvm::json::Value &Params, DocumentSymbolParams &R) |
llvm::json::Value | toJSON (const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, Diagnostic &R) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionContext &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diagnostic &D) |
bool | fromJSON (const llvm::json::Value &Params, CodeActionParams &R) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceEdit &R) |
bool | fromJSON (const llvm::json::Value &Params, ExecuteCommandParams &R) |
llvm::json::Value | toJSON (const SymbolInformation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolInformation &SI) |
bool | operator== (const SymbolDetails &LHS, const SymbolDetails &RHS) |
llvm::json::Value | toJSON (const SymbolDetails &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolDetails &S) |
bool | fromJSON (const llvm::json::Value &Params, WorkspaceSymbolParams &R) |
llvm::json::Value | toJSON (const Command &C) |
llvm::json::Value | toJSON (const CodeAction &CA) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentSymbol &S) |
llvm::json::Value | toJSON (const DocumentSymbol &S) |
llvm::json::Value | toJSON (const WorkspaceEdit &WE) |
llvm::json::Value | toJSON (const ApplyWorkspaceEditParams &Params) |
bool | fromJSON (const llvm::json::Value &Params, TextDocumentPositionParams &R) |
bool | fromJSON (const llvm::json::Value &Params, CompletionContext &R) |
bool | fromJSON (const llvm::json::Value &Params, CompletionParams &R) |
static llvm::StringRef | toTextKind (MarkupKind Kind) |
llvm::json::Value | toJSON (const MarkupContent &MC) |
llvm::json::Value | toJSON (const Hover &H) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKind &Out) |
CompletionItemKind | adjustKindToCapability (CompletionItemKind Kind, CompletionItemKindBitset &supportedCompletionItemKinds) |
bool | fromJSON (const llvm::json::Value &E, CompletionItemKindBitset &Out) |
llvm::json::Value | toJSON (const CompletionItem &CI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const CompletionItem &I) |
bool | operator< (const CompletionItem &L, const CompletionItem &R) |
llvm::json::Value | toJSON (const CompletionList &L) |
llvm::json::Value | toJSON (const ParameterInformation &PI) |
llvm::json::Value | toJSON (const SignatureInformation &SI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SignatureInformation &I) |
llvm::json::Value | toJSON (const SignatureHelp &SH) |
bool | fromJSON (const llvm::json::Value &Params, RenameParams &R) |
llvm::json::Value | toJSON (const DocumentHighlight &DH) |
llvm::json::Value | toJSON (const FileStatus &FStatus) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentHighlight &V) |
bool | fromJSON (const llvm::json::Value &Params, DidChangeConfigurationParams &CCP) |
bool | fromJSON (const llvm::json::Value &Params, ClangdCompileCommand &CDbUpdate) |
bool | fromJSON (const llvm::json::Value &Params, ConfigurationSettings &S) |
bool | fromJSON (const llvm::json::Value &Params, InitializationOptions &Opts) |
bool | fromJSON (const llvm::json::Value &Params, ReferenceParams &R) |
bool | fromJSON (const llvm::json::Value &, NoParams &) |
static bool | isReserved (llvm::StringRef Name) |
static bool | hasDeclInMainFile (const Decl &D) |
static bool | hasUsingDeclInMainFile (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const NamedDecl &ND) |
static SymbolQualitySignals::SymbolCategory | categorize (const CodeCompletionResult &R) |
static SymbolQualitySignals::SymbolCategory | categorize (const index::SymbolInfo &D) |
static bool | isInstanceMember (const NamedDecl *ND) |
static bool | isInstanceMember (const index::SymbolInfo &D) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolQualitySignals &S) |
static SymbolRelevanceSignals::AccessibleScope | computeScope (const NamedDecl *D) |
static std::pair< float, unsigned > | uriProximity (llvm::StringRef SymbolURI, URIDistance *D) |
static float | scopeBoost (ScopeDistance &Distance, llvm::Optional< llvm::StringRef > SymbolScope) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolRelevanceSignals &S) |
float | evaluateSymbolAndRelevance (float SymbolQuality, float SymbolRelevance) |
Combine symbol quality and relevance into a single score. More... | |
static uint32_t | encodeFloat (float F) |
std::string | sortText (float Score, llvm::StringRef Tiebreak="") |
Returns a string that sorts in the same order as (-Score, Tiebreak), for LSP. More... | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SignatureQualitySignals &S) |
template<typename Callback > | |
static bool | iterateCodepoints (llvm::StringRef U8, const Callback &CB) |
static size_t | measureUTF16 (llvm::StringRef U8, int U16Units, bool &Valid) |
size_t | lspLength (llvm::StringRef Code) |
llvm::Expected< size_t > | positionToOffset (llvm::StringRef Code, Position P, bool AllowColumnsBeyondLineLength=true) |
Turn a [line, column] pair into an offset in Code. More... | |
Position | offsetToPosition (llvm::StringRef Code, size_t Offset) |
Turn an offset in Code into a [line, column] pair. More... | |
Position | sourceLocToPosition (const SourceManager &SM, SourceLocation Loc) |
Turn a SourceLocation into a [line, column] pair. More... | |
Range | halfOpenToRange (const SourceManager &SM, CharSourceRange R) |
std::pair< size_t, size_t > | offsetToClangLineColumn (llvm::StringRef Code, size_t Offset) |
std::pair< llvm::StringRef, llvm::StringRef > | splitQualifiedName (llvm::StringRef QName) |
From "a::b::c", return {"a::b::", "c"}. More... | |
TextEdit | replacementToEdit (llvm::StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (llvm::StringRef Code, const tooling::Replacements &Repls) |
llvm::Optional< std::string > | getCanonicalPath (const FileEntry *F, const SourceManager &SourceMgr) |
Get the canonical path of F . More... | |
TextEdit | toTextEdit (const FixItHint &FixIt, const SourceManager &M, const LangOptions &L) |
bool | IsRangeConsecutive (const Range &Left, const Range &Right) |
FileDigest | digest (llvm::StringRef Content) |
llvm::Optional< FileDigest > | digestFile (const SourceManager &SM, FileID FID) |
FileDigest | digest (StringRef Content) |
size_t | lspLength (StringRef Code) |
TextEdit | replacementToEdit (StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (StringRef Code, const tooling::Replacements &Repls) |
Deadline | timeoutSeconds (llvm::Optional< double > Seconds) |
Makes a deadline from a timeout in seconds. None means wait forever. More... | |
void | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D) |
Wait once on CV for the specified duration. More... | |
void | setCurrentThreadPriority (ThreadPriority Priority) |
void | preventThreadStarvationInTests () |
template<typename Func > | |
LLVM_NODISCARD bool | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D, Func F) |
Waits on a condition variable until F() is true or D expires. More... | |
static llvm::cl::opt< bool > | UseDex ("use-dex-index", llvm::cl::desc("Use experimental Dex dynamic index."), llvm::cl::init(false), llvm::cl::Hidden) |
static llvm::cl::opt< Path > | CompileCommandsDir ("compile-commands-dir", llvm::cl::desc("Specify a path to look for compile_commands.json. If path " "is invalid, clangd will look in the current directory and " "parent paths of each source file.")) |
static llvm::cl::opt< unsigned > | WorkerThreadsCount ("j", llvm::cl::desc("Number of async workers used by clangd"), llvm::cl::init(getDefaultAsyncThreadsCount())) |
static llvm::cl::opt< CompletionStyleFlag > | CompletionStyle ("completion-style", llvm::cl::desc("Granularity of code completion suggestions"), llvm::cl::values(clEnumValN(Detailed, "detailed", "One completion item for each semantically distinct " "completion, with full type information."), clEnumValN(Bundled, "bundled", "Similar completion items (e.g. function overloads) are " "combined. Type information shown where possible.")), llvm::cl::init(Detailed)) |
static llvm::cl::opt< bool > | IncludeIneligibleResults ("include-ineligible-results", llvm::cl::desc("Include ineligible completion results (e.g. private members)"), llvm::cl::init(CodeCompleteOptions().IncludeIneligibleResults), llvm::cl::Hidden) |
static llvm::cl::opt< JSONStreamStyle > | InputStyle ("input-style", llvm::cl::desc("Input JSON stream encoding"), llvm::cl::values(clEnumValN(JSONStreamStyle::Standard, "standard", "usual LSP protocol"), clEnumValN(JSONStreamStyle::Delimited, "delimited", "messages delimited by --- lines, with # comment support")), llvm::cl::init(JSONStreamStyle::Standard)) |
static llvm::cl::opt< bool > | PrettyPrint ("pretty", llvm::cl::desc("Pretty-print JSON output"), llvm::cl::init(false)) |
static llvm::cl::opt< Logger::Level > | LogLevel ("log", llvm::cl::desc("Verbosity of log messages written to stderr"), llvm::cl::values(clEnumValN(Logger::Error, "error", "Error messages only"), clEnumValN(Logger::Info, "info", "High level execution tracing"), clEnumValN(Logger::Debug, "verbose", "Low level details")), llvm::cl::init(Logger::Info)) |
static llvm::cl::opt< bool > | Test ("lit-test", llvm::cl::desc("Abbreviation for -input-style=delimited -pretty " "-run-synchronously -enable-test-scheme. " "Intended to simplify lit tests."), llvm::cl::init(false), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | EnableTestScheme ("enable-test-uri-scheme", llvm::cl::desc("Enable 'test:' URI scheme. Only use in lit tests."), llvm::cl::init(false), llvm::cl::Hidden) |
static llvm::cl::opt< PCHStorageFlag > | PCHStorage ("pch-storage", llvm::cl::desc("Storing PCHs in memory increases memory usages, but may " "improve performance"), llvm::cl::values(clEnumValN(PCHStorageFlag::Disk, "disk", "store PCHs on disk"), clEnumValN(PCHStorageFlag::Memory, "memory", "store PCHs in memory")), llvm::cl::init(PCHStorageFlag::Disk)) |
static llvm::cl::opt< int > | LimitResults ("limit-results", llvm::cl::desc("Limit the number of results returned by clangd. " "0 means no limit."), llvm::cl::init(100)) |
static llvm::cl::opt< bool > | RunSynchronously ("run-synchronously", llvm::cl::desc("Parse on main thread. If set, -j is ignored"), llvm::cl::init(false), llvm::cl::Hidden) |
static llvm::cl::opt< Path > | ResourceDir ("resource-dir", llvm::cl::desc("Directory for system clang headers"), llvm::cl::init(""), llvm::cl::Hidden) |
static llvm::cl::opt< Path > | InputMirrorFile ("input-mirror-file", llvm::cl::desc("Mirror all LSP input to the specified file. Useful for debugging."), llvm::cl::init(""), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | EnableIndex ("index", llvm::cl::desc("Enable index-based features. By default, clangd maintains an index " "built from symbols in opened files. Global index support needs to " "enabled separatedly."), llvm::cl::init(true), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | AllScopesCompletion ("all-scopes-completion", llvm::cl::desc("If set to true, code completion will include index symbols that are " "not defined in the scopes (e.g. " "namespaces) visible from the code completion point. Such completions " "can insert scope qualifiers."), llvm::cl::init(true)) |
static llvm::cl::opt< bool > | ShowOrigins ("debug-origin", llvm::cl::desc("Show origins of completion items"), llvm::cl::init(CodeCompleteOptions().ShowOrigins), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | HeaderInsertionDecorators ("header-insertion-decorators", llvm::cl::desc("Prepend a circular dot or space before the completion " "label, depending on whether " "an include line will be inserted or not."), llvm::cl::init(true)) |
static llvm::cl::opt< Path > | IndexFile ("index-file", llvm::cl::desc("Index file to build the static index. The file must have been created " "by a compatible clangd-index.\ "WARNING:This option is experimental only, and will be removed " "eventually. Don 't rely on it."), llvm::cl::init(""), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | EnableBackgroundIndex ("background-index", llvm::cl::desc("Index project code in the background and persist index on disk. " "Experimental"), llvm::cl::init(false), llvm::cl::Hidden) |
static llvm::cl::opt< int > | BackgroundIndexRebuildPeriod ("background-index-rebuild-period", llvm::cl::desc("If set to non-zero, the background index rebuilds the symbol index " "periodically every X milliseconds; otherwise, the " "symbol index will be updated for each indexed file."), llvm::cl::init(5000), llvm::cl::Hidden) |
static llvm::cl::opt< CompileArgsFrom > | CompileArgsFrom ("compile_args_from", llvm::cl::desc("The source of compile commands"), llvm::cl::values(clEnumValN(LSPCompileArgs, "lsp", "All compile commands come from LSP and " "'compile_commands.json' files are ignored"), clEnumValN(FilesystemCompileArgs, "filesystem", "All compile commands come from the " "'compile_commands.json' files")), llvm::cl::init(FilesystemCompileArgs), llvm::cl::Hidden) |
static llvm::cl::opt< bool > | EnableFunctionArgSnippets ("function-arg-placeholders", llvm::cl::desc("When disabled, completions contain only parentheses for " "function calls. When enabled, completions also contain " "placeholders for method parameters."), llvm::cl::init(CodeCompleteOptions().EnableFunctionArgSnippets)) |
unsigned | getDefaultAsyncThreadsCount () |
Returns a number of a default async threads to use for TUScheduler. More... | |
template<typename T > | |
std::future< T > | runAsync (llvm::unique_function< T()> Action) |
Runs Action asynchronously with a new std::thread. More... | |
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< Location > | findDefinitions (ParsedAST &AST, Position Pos, const SymbolIndex *Index=nullptr) |
Get definition of symbol at a specified Pos . More... | |
std::vector< DocumentHighlight > | findDocumentHighlights (ParsedAST &AST, Position Pos) |
Returns highlights for all usages of a symbol at Pos . More... | |
static PrintingPolicy | printingPolicyForDecls (PrintingPolicy Base) |
static std::string | typeDeclToString (const TypeDecl *TD) |
Return a string representation (e.g. More... | |
static std::string | namedDeclQualifiedName (const NamedDecl *ND, llvm::StringRef Prefix) |
Return a string representation (e.g. More... | |
static llvm::Optional< std::string > | getScopeName (const Decl *D) |
Given a declaration D , return a human-readable string representing the scope in which it is declared. More... | |
static Hover | getHoverContents (const Decl *D) |
Generate a Hover object given the declaration D . More... | |
static Hover | getHoverContents (QualType T, ASTContext &ASTCtx) |
Generate a Hover object given the type T . More... | |
static Hover | getHoverContents (llvm::StringRef MacroName) |
Generate a Hover object given the macro MacroInf . More... | |
llvm::Optional< QualType > | getDeducedType (ParsedAST &AST, SourceLocation SourceLocationBeg) |
Retrieves the deduced type at a given location (auto, decltype). More... | |
llvm::Optional< Hover > | getHover (ParsedAST &AST, Position Pos) |
Get the hover information when hovering at Pos . More... | |
std::vector< Location > | findReferences (ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index=nullptr) |
Returns reference locations of the symbol at a specified Pos . More... | |
std::vector< SymbolDetails > | getSymbolInfo (ParsedAST &AST, Position Pos) |
Get info about symbols at Pos . More... | |
Variables | |
static Key< std::shared_ptr< std::atomic< bool > > > | FlagKey |
static constexpr int | AwfulScore = -(1 << 13) |
static constexpr int | PerfectBonus = 3 |
static constexpr uint8_t | CharTypes [] |
static constexpr uint8_t | CharRoles [] |
constexpr auto | CompletionItemKindMin |
constexpr auto | CompletionItemKindMax |
constexpr auto | SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
constexpr auto | SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
static std::atomic< bool > | AvoidThreadStarvation = {false} |
static clang::clangd::Key< std::string > | kFileBeingProcessed |
using clang::clangd::Callback = typedef llvm::unique_function<void(llvm::Expected<T>)> |
A Callback<T> is a void function that accepts Expected<T>.
This is accepted by ClangdServer functions that logically return T.
Definition at line 29 of file Function.h.
using clang::clangd::Canceler = typedef std::function<void()> |
A canceller requests cancellation of a task, when called.
Calling it again has no effect.
Definition at line 71 of file Cancellation.h.
using clang::clangd::CharTypeSet = typedef unsigned char |
Definition at line 50 of file FuzzyMatch.h.
using clang::clangd::CompletionItemKindBitset = typedef std::bitset<CompletionItemKindMax + 1> |
Definition at line 292 of file Protocol.h.
using clang::clangd::ExitParams = typedef NoParams |
Definition at line 242 of file Protocol.h.
using clang::clangd::FileDigest = typedef decltype(llvm::SHA1::hash({})) |
Definition at line 31 of file SourceCode.h.
using clang::clangd::IncludeGraph = typedef llvm::StringMap<IncludeGraphNode> |
using clang::clangd::Path = typedef std::string |
using clang::clangd::PathRef = typedef llvm::StringRef |
using clang::clangd::PreambleParsedCallback = typedef std::function<void(ASTContext &, std::shared_ptr<clang::Preprocessor>)> |
Definition at line 136 of file ClangdUnit.h.
using clang::clangd::ShutdownParams = typedef NoParams |
Definition at line 241 of file Protocol.h.
using clang::clangd::SymbolKindBitset = typedef std::bitset<SymbolKindMax + 1> |
Definition at line 330 of file Protocol.h.
typedef llvm::Registry<URIScheme> clang::clangd::URISchemeRegistry |
enum clang::clangd::CharRole : unsigned char |
Enumerator | |
---|---|
Unknown | |
Tail | |
Head | |
Separator |
Definition at line 56 of file FuzzyMatch.h.
enum clang::clangd::CharType : unsigned char |
Enumerator | |
---|---|
Empty | |
Lower | |
Upper | |
Punctuation |
Definition at line 42 of file FuzzyMatch.h.
Enumerator | |
---|---|
LSPCompileArgs | |
FilesystemCompileArgs |
Definition at line 187 of file ClangdMain.cpp.
|
strong |
The kind of a completion entry.
Definition at line 259 of file Protocol.h.
Enumerator | |
---|---|
Detailed | |
Bundled |
Definition at line 49 of file ClangdMain.cpp.
|
strong |
Definition at line 778 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Text | |
Read | |
Write |
Definition at line 971 of file Protocol.h.
|
strong |
How to handle duplicated symbols across multiple files.
Enumerator | |
---|---|
PickOne | |
Merge |
Definition at line 38 of file FileIndex.h.
|
strong |
Enumerator | |
---|---|
ParseError | |
InvalidRequest | |
MethodNotFound | |
InvalidParams | |
InternalError | |
ServerNotInitialized | |
UnknownErrorCode | |
RequestCancelled |
Definition at line 38 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Created | The file got created. |
Changed | The file got changed. |
Deleted | The file got deleted. |
Definition at line 479 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
RIFF | |
YAML |
Definition at line 34 of file Serialization.h.
|
strong |
Select between in-memory index implementations, which have tradeoffs.
Enumerator | |
---|---|
Light | |
Heavy |
Definition at line 30 of file FileIndex.h.
|
strong |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Definition at line 826 of file Protocol.h.
Enumerator | |
---|---|
Standard | |
Delimited |
Definition at line 66 of file Transport.h.
|
strong |
Enumerator | |
---|---|
PlainText | |
Markdown |
Definition at line 803 of file Protocol.h.
Enumerator | |
---|---|
Disk | |
Memory |
Definition at line 103 of file ClangdMain.cpp.
|
strong |
|
strong |
A symbol kind.
Definition at line 299 of file Protocol.h.
|
strong |
|
strong |
Defines how the host (editor) should sync document changes to the language server.
Definition at line 246 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Low | |
Normal |
Definition at line 121 of file Threading.h.
|
strong |
Enumerator | |
---|---|
Off | |
Messages | |
Verbose |
Definition at line 232 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 39 of file TUScheduler.h.
void clang::clangd::addSystemHeadersMapping | ( | CanonicalIncludes * | Includes | ) |
Adds mapping for system headers and some special symbols (e.g.
STL symbols in <iosfwd> need to be mapped individually). Approximately, the following system headers are handled:
Definition at line 109 of file CanonicalIncludes.cpp.
SymbolKind clang::clangd::adjustKindToCapability | ( | SymbolKind | Kind, |
SymbolKindBitset & | SupportedSymbolKinds | ||
) |
Definition at line 198 of file Protocol.cpp.
References Class, Enum, EnumMember, Kind, String, Struct, and SymbolKindMin.
Referenced by asCommand().
CompletionItemKind clang::clangd::adjustKindToCapability | ( | CompletionItemKind | Kind, |
CompletionItemKindBitset & | supportedCompletionItemKinds | ||
) |
Definition at line 622 of file Protocol.cpp.
References Class, CompletionItemKindMin, Enum, EnumMember, File, Folder, Kind, Struct, and Text.
|
static |
|
static |
Definition at line 585 of file ClangdLSPServer.cpp.
References Action, adjustKindToCapability(), Bind(), clang::clangd::CodeAction::command, Command, Commands(), clang::clangd::ConfigurationSettings::compilationDatabaseChanges, clang::clangd::CodeActionParams::context, clang::clangd::URI::createFile(), D, clang::clangd::CodeActionContext::diagnostics, clang::clangd::CodeAction::edit, clang::clangd::URIForFile::file(), File, InvalidParams, clang::clangd::CompletionList::isIncomplete, clang::clangd::CompletionList::items, clang::clangd::CodeAction::kind, clang::clangd::CompletionItem::kind, None, clang::clangd::TextDocumentPositionParams::position, clang::clangd::CodeAction::QUICKFIX_KIND, Result, clang::clangd::DidChangeConfigurationParams::settings, clang::clangd::CodeActionParams::textDocument, clang::clangd::TextDocumentPositionParams::textDocument, clang::clangd::CodeAction::title, toCodeAction(), clang::clangd::URI::toString(), and clang::clangd::TextDocumentIdentifier::uri.
|
static |
ForwardBinder<Func, Args...> clang::clangd::Bind | ( | Func | F, |
Args &&... | As | ||
) |
Creates an object that stores a callable (F
) and first arguments to the callable (As
) and allows to call F
with at a later point.
Similar to std::bind, but also works with move-only F
and As
.
The returned object must be called no more than once, as As
are std::forwarded'ed (therefore can be moved) into F
during the call.
Definition at line 82 of file Function.h.
Referenced by asCommand(), clang::clangd::ClangdServer::documentSymbols(), clang::clangd::ClangdServer::dumpAST(), clang::clangd::ClangdServer::findDefinitions(), clang::clangd::ClangdServer::findDocumentHighlights(), clang::clangd::ClangdServer::findHover(), clang::clangd::ClangdServer::signatureHelp(), and clang::clangd::ClangdServer::symbolInfo().
llvm::Optional< ParsedAST > clang::clangd::buildAST | ( | PathRef | FileName, |
std::unique_ptr< CompilerInvocation > | Invocation, | ||
const ParseInputs & | Inputs, | ||
std::shared_ptr< const PreambleData > | Preamble, | ||
std::shared_ptr< PCHContainerOperations > | PCHs | ||
) |
Build an AST from provided user inputs.
This function does not check if preamble can be reused, as this function expects that Preamble
is the result of calling buildPreamble.
Definition at line 523 of file ClangdUnit.cpp.
std::unique_ptr< CompilerInvocation > clang::clangd::buildCompilerInvocation | ( | const ParseInputs & | Inputs | ) |
Builds compiler invocation that could be used to build AST or preamble.
Definition at line 426 of file ClangdUnit.cpp.
References clang::clangd::ParseInputs::CompileCommand, clang::clangd::ParseInputs::FS, and log().
std::shared_ptr< const PreambleData > clang::clangd::buildPreamble | ( | PathRef | FileName, |
CompilerInvocation & | CI, | ||
std::shared_ptr< const PreambleData > | OldPreamble, | ||
const tooling::CompileCommand & | OldCompileCommand, | ||
const ParseInputs & | Inputs, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
bool | StoreInMemory, | ||
PreambleParsedCallback | PreambleCallback | ||
) |
Rebuild the preamble for the new inputs unless the old one can be reused.
If OldPreamble
can be reused, it is returned unchanged. If OldPreamble
is null, always builds the preamble. If PreambleCallback
is set, it will be run on top of the AST while building the preamble. Note that if the old preamble was reused, no AST is built and, therefore, the callback will not be executed.
Definition at line 454 of file ClangdUnit.cpp.
References clang::clangd::ParseInputs::CompileCommand, clang::clangd::ParseInputs::Contents, clang::clangd::ParseInputs::FS, and vlog().
CharTypeSet clang::clangd::calculateRoles | ( | llvm::StringRef | Text, |
llvm::MutableArrayRef< CharRole > | Roles | ||
) |
Definition at line 155 of file FuzzyMatch.cpp.
References AwfulScore, CharRoles, CharTypes, Empty, Head, Lower, lower(), Tail, and Upper.
Referenced by clang::clangd::FuzzyMatcher::FuzzyMatcher(), and clang::clangd::dex::generateIdentifierTrigrams().
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 false until the Canceler is invoked, and true afterwards.
Definition at line 19 of file Cancellation.cpp.
References clang::clangd::Context::current(), and clang::clangd::Context::derive().
|
static |
Definition at line 47 of file FileDistance.cpp.
References hash_value(), Result, clang::clangd::FileDistance::RootHash, and clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::FileDistance::distance().
|
static |
Definition at line 63 of file Quality.cpp.
References Constructor, Function, MAP, Namespace, clang::clangd::SymbolQualitySignals::Operator, Unknown, and Variable.
Referenced by categorize(), and clang::clangd::SymbolQualitySignals::merge().
|
static |
Definition at line 93 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 119 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, Unknown, clang::clangd::SymbolQualitySignals::Unknown, and clang::clangd::SymbolQualitySignals::Variable.
CodeCompleteResult clang::clangd::codeComplete | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
const PreambleData * | Preamble, | ||
StringRef | Contents, | ||
Position | Pos, | ||
IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
CodeCompleteOptions | Opts, | ||
SpeculativeFuzzyFind * | SpecFuzzyFind = nullptr |
||
) |
Get code completions at a specified Pos
in FileName
.
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.
CodeCompleteResult clang::clangd::codeComplete | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
const PreambleData * | Preamble, | ||
llvm::StringRef | Contents, | ||
Position | Pos, | ||
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
CodeCompleteOptions | Opts, | ||
SpeculativeFuzzyFind * | SpecFuzzyFind | ||
) |
Definition at line 1617 of file CodeComplete.cpp.
std::unique_ptr< PPCallbacks > clang::clangd::collectIncludeStructureCallback | ( | const SourceManager & | SM, |
IncludeStructure * | Out | ||
) |
Returns a PPCallback that visits all inclusions in the main file.
Definition at line 78 of file Headers.cpp.
std::unique_ptr< CommentHandler > clang::clangd::collectIWYUHeaderMaps | ( | CanonicalIncludes * | Includes | ) |
Returns a CommentHandler that parses pragma comment on include files to determine when we should include a different header from the header that directly defines a symbol.
Mappinps are registered with Includes
.
Currently it only supports IWYU private pragma: https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-private
Definition at line 84 of file CanonicalIncludes.cpp.
|
static |
|
static |
|
static |
|
static |
Definition at line 262 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::ClassScope, clang::clangd::SymbolRelevanceSignals::FileScope, clang::clangd::SymbolRelevanceSignals::FunctionScope, and clang::clangd::SymbolRelevanceSignals::GlobalScope.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
Definition at line 187 of file FileDistance.cpp.
std::unique_ptr< FrontendAction > clang::clangd::createStaticIndexingAction | ( | SymbolCollector::Options | Opts, |
std::function< void(SymbolSlab)> | SymbolsCallback, | ||
std::function< void(RefSlab)> | RefsCallback, | ||
std::function< void(IncludeGraph)> | IncludeGraphCallback | ||
) |
Definition at line 167 of file IndexAction.cpp.
|
static |
Definition at line 23 of file Context.cpp.
References clang::clangd::Context::empty().
Referenced by clang::clangd::Context::current(), and clang::clangd::Context::swapCurrent().
FileDigest clang::clangd::digest | ( | StringRef | Content | ) |
FileDigest clang::clangd::digest | ( | llvm::StringRef | Content | ) |
Definition at line 240 of file SourceCode.cpp.
Optional< FileDigest > clang::clangd::digestFile | ( | const SourceManager & | SM, |
FileID | FID | ||
) |
Definition at line 244 of file SourceCode.cpp.
void clang::clangd::dumpAST | ( | ParsedAST & | AST, |
llvm::raw_ostream & | OS | ||
) |
For testing/debugging purposes.
Note that this method deserializes all unserialized Decls, so use with care.
Definition at line 222 of file ClangdUnit.cpp.
References clang::clangd::ParsedAST::getASTContext().
Referenced by clang::clangd::ClangdServer::dumpAST().
void clang::clangd::elog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 57 of file Logger.h.
References clang::clangd::Logger::Error, and clang::clangd::detail::log().
Referenced by clang::clangd::ClangdLSPServer::MessageHandler::bind(), clang::clangd::URIForFile::canonicalize(), fromJSON(), clang::clangd::ClangdLSPServer::MessageHandler::onNotify(), clang::clangd::TUScheduler::remove(), and xpcToJson().
|
static |
|
static |
|
static |
|
static |
Referenced by main().
|
static |
Definition at line 440 of file Quality.cpp.
Referenced by sortText().
float clang::clangd::evaluateSymbolAndRelevance | ( | float | SymbolQuality, |
float | SymbolRelevance | ||
) |
Combine symbol quality and relevance into a single score.
Definition at line 434 of file Quality.cpp.
std::vector< Location > clang::clangd::findDefinitions | ( | ParsedAST & | AST, |
Position | Pos, | ||
const SymbolIndex * | Index | ||
) |
Get definition of symbol at a specified Pos
.
Definition at line 244 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findDefinitions().
std::vector< DocumentHighlight > clang::clangd::findDocumentHighlights | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Returns highlights for all usages of a symbol at Pos
.
Definition at line 434 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findDocumentHighlights().
SourceLocation clang::clangd::findNameLoc | ( | const clang::Decl * | D | ) |
std::vector< Location > clang::clangd::findReferences | ( | ParsedAST & | AST, |
Position | Pos, | ||
uint32_t | Limit, | ||
const SymbolIndex * | Index = nullptr |
||
) |
|
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 542 of file ClangdLSPServer.cpp.
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 172 of file CodeCompletionStrings.cpp.
References Result.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
URIForFile & | R | ||
) |
Definition at line 53 of file Protocol.cpp.
References elog(), clang::clangd::URIForFile::fromURI(), and clang::clangd::URI::parse().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentIdentifier & | R | ||
) |
Definition at line 87 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Position & | R | ||
) |
Definition at line 92 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 | ||
) |
Definition at line 108 of file Protocol.cpp.
References clang::clangd::Range::end, and clang::clangd::Range::start.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentItem & | R | ||
) |
Definition at line 135 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, |
TextEdit & | R | ||
) |
Definition at line 141 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TraceLevel & | Out | ||
) |
Definition at line 159 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKind & | Out | ||
) |
Definition at line 175 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Parameters, |
FuzzyFindRequest & | Request | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
SymbolKindBitset & | Out | ||
) |
Definition at line 186 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClientCapabilities & | R | ||
) |
Definition at line 216 of file Protocol.cpp.
References clang::clangd::ClientCapabilities::DiagnosticCategory, and clang::clangd::ClientCapabilities::DiagnosticFixes.
|
inline |
Definition at line 240 of file Protocol.h.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializeParams & | R | ||
) |
Definition at line 264 of file Protocol.cpp.
References clang::clangd::InitializeParams::capabilities, clang::clangd::InitializeParams::initializationOptions, clang::clangd::InitializeParams::processId, clang::clangd::InitializeParams::rootPath, clang::clangd::InitializeParams::rootUri, and clang::clangd::InitializeParams::trace.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidOpenTextDocumentParams & | R | ||
) |
Definition at line 279 of file Protocol.cpp.
References clang::clangd::DidOpenTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidCloseTextDocumentParams & | R | ||
) |
Definition at line 284 of file Protocol.cpp.
References clang::clangd::DidCloseTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeTextDocumentParams & | R | ||
) |
Definition at line 289 of file Protocol.cpp.
References clang::clangd::DidChangeTextDocumentParams::contentChanges, clang::clangd::DidChangeTextDocumentParams::textDocument, and clang::clangd::DidChangeTextDocumentParams::wantDiagnostics.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
FileChangeType & | Out | ||
) |
Definition at line 296 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
FileEvent & | R | ||
) |
Definition at line 307 of file Protocol.cpp.
References clang::clangd::FileEvent::type, and clang::clangd::FileEvent::uri.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DidChangeWatchedFilesParams & | R | ||
) |
Definition at line 312 of file Protocol.cpp.
References clang::clangd::DidChangeWatchedFilesParams::changes.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentContentChangeEvent & | R | ||
) |
Definition at line 317 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, |
FormattingOptions & | R | ||
) |
Definition at line 324 of file Protocol.cpp.
References clang::clangd::FormattingOptions::insertSpaces, and clang::clangd::FormattingOptions::tabSize.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentRangeFormattingParams & | R | ||
) |
Definition at line 337 of file Protocol.cpp.
References clang::clangd::DocumentRangeFormattingParams::options, clang::clangd::DocumentRangeFormattingParams::range, and clang::clangd::DocumentRangeFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentOnTypeFormattingParams & | R | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentFormattingParams & | R | ||
) |
Definition at line 352 of file Protocol.cpp.
References clang::clangd::DocumentFormattingParams::options, and clang::clangd::DocumentFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
DocumentSymbolParams & | R | ||
) |
Definition at line 358 of file Protocol.cpp.
References clang::clangd::DocumentSymbolParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
Diagnostic & | R | ||
) |
Definition at line 376 of file Protocol.cpp.
References clang::clangd::Diagnostic::category, clang::clangd::Diagnostic::message, clang::clangd::Diagnostic::range, and clang::clangd::Diagnostic::severity.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionContext & | R | ||
) |
Definition at line 385 of file Protocol.cpp.
References clang::clangd::CodeActionContext::diagnostics.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CodeActionParams & | R | ||
) |
Definition at line 412 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, |
WorkspaceEdit & | R | ||
) |
Definition at line 418 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changes, and clang::clangd::ExecuteCommandParams::CLANGD_APPLY_FIX_COMMAND.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ExecuteCommandParams & | R | ||
) |
Definition at line 425 of file Protocol.cpp.
References clang::clangd::ExecuteCommandParams::command.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
WorkspaceSymbolParams & | R | ||
) |
Definition at line 492 of file Protocol.cpp.
References clang::clangd::WorkspaceSymbolParams::query.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
TextDocumentPositionParams & | R | ||
) |
Definition at line 552 of file Protocol.cpp.
References clang::clangd::TextDocumentPositionParams::position, and clang::clangd::TextDocumentPositionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionContext & | R | ||
) |
Definition at line 558 of file Protocol.cpp.
References fromJSON(), clang::clangd::CompletionContext::triggerCharacter, and clang::clangd::CompletionContext::triggerKind.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
CompletionParams & | R | ||
) |
Definition at line 573 of file Protocol.cpp.
References clang::clangd::CompletionParams::context, fromJSON(), and clang::clangd::Context::get().
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKind & | Out | ||
) |
Definition at line 610 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
CompletionItemKindBitset & | Out | ||
) |
Definition at line 643 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
RenameParams & | R | ||
) |
Definition at line 735 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, |
DidChangeConfigurationParams & | CCP | ||
) |
Definition at line 765 of file Protocol.cpp.
References clang::clangd::DidChangeConfigurationParams::settings.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ClangdCompileCommand & | CDbUpdate | ||
) |
Definition at line 771 of file Protocol.cpp.
References clang::clangd::ClangdCompileCommand::compilationCommand, and clang::clangd::ClangdCompileCommand::workingDirectory.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ConfigurationSettings & | S | ||
) |
Definition at line 778 of file Protocol.cpp.
References clang::clangd::ConfigurationSettings::compilationDatabaseChanges.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
InitializationOptions & | Opts | ||
) |
Definition at line 786 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | Params, |
ReferenceParams & | R | ||
) |
Definition at line 798 of file Protocol.cpp.
References fromJSON().
SourceLocation clang::clangd::getBeginningOfIdentifier | ( | ParsedAST & | Unit, |
const Position & | Pos, | ||
const FileID | FID | ||
) |
Get the beginning SourceLocation at a specified Pos
.
May be invalid if Pos is, or if there's no identifier.
Definition at line 545 of file ClangdUnit.cpp.
References AST, and clang::clangd::ParsedAST::getASTContext().
llvm::Optional< std::string > clang::clangd::getCanonicalPath | ( | const FileEntry * | F, |
const SourceManager & | SourceMgr | ||
) |
Get the canonical path of F
.
This means:
This function should be used when paths needs to be used outside the component that generate it, so that paths are normalized as much as possible.
Definition at line 187 of file SourceCode.cpp.
std::string clang::clangd::getDeclComment | ( | const ASTContext & | Ctx, |
const NamedDecl & | Decl | ||
) |
Similar to getDocComment, but returns the comment for a NamedDecl.
Definition at line 57 of file CodeCompletionStrings.cpp.
Referenced by getDocComment().
llvm::Optional<QualType> clang::clangd::getDeducedType | ( | ParsedAST & | AST, |
SourceLocation | SourceLocationBeg | ||
) |
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 762 of file TUScheduler.cpp.
std::string clang::clangd::getDocComment | ( | const ASTContext & | Ctx, |
const CodeCompletionResult & | Result, | ||
bool | CommentsFromHeaders | ||
) |
Gets a minimally formatted documentation comment of Result
, with comment markers stripped.
See clang::RawComment::getFormattedText() for the detailed explanation of how the comment text is transformed. Returns empty string when no comment is available. If CommentsFromHeaders
parameter is set, only comments from the main file will be returned. It is used to workaround crashes when parsing comments in the stale headers, coming from completion preamble.
Definition at line 45 of file CodeCompletionStrings.cpp.
References getDeclComment().
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 322 of file FindSymbols.cpp.
Referenced by clang::clangd::ClangdServer::documentSymbols().
|
static |
Definition at line 43 of file GlobalCompilationDatabase.cpp.
Referenced by clang::clangd::GlobalCompilationDatabase::getFallbackCommand().
Get the hover information when hovering at Pos
.
Definition at line 686 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findHover().
|
static |
Generate a Hover
object given the declaration D
.
Definition at line 521 of file XRefs.cpp.
References clang::clangd::Hover::contents, getScopeName(), printingPolicyForDecls(), and clang::clangd::MarkupContent::value.
|
static |
|
static |
Generate a Hover
object given the macro MacroInf
.
Definition at line 565 of file XRefs.cpp.
References clang::clangd::Hover::contents, and clang::clangd::MarkupContent::value.
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 202 of file CodeCompletionStrings.cpp.
|
static |
Given a declaration D
, return a human-readable string representing the scope in which it is declared.
If the declaration is in the global scope, return the string "global namespace".
Definition at line 505 of file XRefs.cpp.
References namedDeclQualifiedName(), None, and typeDeclToString().
Referenced by getHoverContents().
int clang::clangd::getSeverity | ( | DiagnosticsEngine::Level | L | ) |
Convert from clang diagnostic level to LSP severity.
Definition at line 275 of file Diagnostics.cpp.
void clang::clangd::getSignature | ( | const CodeCompletionString & | CCS, |
std::string * | Signature, | ||
std::string * | Snippet, | ||
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 = "(${0: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.
Definition at line 76 of file CodeCompletionStrings.cpp.
llvm::Optional< SymbolID > clang::clangd::getSymbolID | ( | const Decl * | D | ) |
llvm::Optional< SymbolID > clang::clangd::getSymbolID | ( | const IdentifierInfo & | II, |
const MacroInfo * | MI, | ||
const SourceManager & | SM | ||
) |
Gets the symbol ID for a macro, if possible.
Currently, this is an encoded USR of the macro, which incorporates macro locations (e.g. file name, offset in file). FIXME: the USR semantics might not be stable enough as the ID for index macro (e.g. a change in definition offset can result in a different USR). We could change these semantics in the future by reimplementing this funcure (e.g. avoid USR for macros).
std::vector< SymbolDetails > clang::clangd::getSymbolInfo | ( | ParsedAST & | AST, |
Position | Pos | ||
) |
Get info about symbols at Pos
.
Definition at line 765 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::symbolInfo().
|
static |
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 (namepaces, 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 103 of file FindSymbols.cpp.
Range clang::clangd::halfOpenToRange | ( | const SourceManager & | SM, |
CharSourceRange | R | ||
) |
Definition at line 145 of file SourceCode.cpp.
Referenced by toTextEdit().
|
static |
Definition at line 42 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
llvm::hash_code clang::clangd::hash_value | ( | const SymbolID & | ID | ) |
Definition at line 51 of file SymbolID.cpp.
Referenced by canonicalize(), clang::clangd::FileDistance::distance(), clang::clangd::URIDistance::distance(), and llvm::DenseMapInfo< clang::clangd::SymbolID >::getHashValue().
|
static |
Definition at line 52 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
|
static |
|
static |
SymbolSlab clang::clangd::indexHeaderSymbols | ( | ASTContext & | AST, |
std::shared_ptr< Preprocessor > | PP | ||
) |
Idex declarations from AST
and macros from PP
that are declared in included headers.
Definition at line 80 of file FileIndex.cpp.
std::pair< SymbolSlab, RefSlab > clang::clangd::indexMainDecls | ( | ParsedAST & | AST | ) |
Retrieves symbols and refs of local top level decls in AST
(i.e.
AST.getLocalTopLevelDecls()
). Exposed to assist in unit tests.
Definition at line 74 of file FileIndex.cpp.
References clang::clangd::ParsedAST::getASTContext(), clang::clangd::ParsedAST::getLocalTopLevelDecls(), clang::clangd::ParsedAST::getPreprocessorPtr(), and indexSymbols().
Referenced by clang::clangd::FileIndex::updateMain().
|
static |
Definition at line 31 of file FileIndex.cpp.
Referenced by indexMainDecls().
|
static |
Referenced by main().
|
static |
Referenced by main().
|
static |
Definition at line 74 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::dumpLast(), and clang::clangd::FuzzyMatcher::match().
bool clang::clangd::isCancelled | ( | const Context & | Ctx = Context::current() | ) |
True if the current context is within a cancelable task which was cancelled.
Always false if there is no active cancelable task. This isn't free (context lookup) - don't call it in a tight loop.
Definition at line 27 of file Cancellation.cpp.
References clang::clangd::Context::get().
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 44 of file AST.cpp.
References isSpelledInSourceCode().
Referenced by clang::clangd::SymbolQualitySignals::merge().
bool clang::clangd::isIndexedForCodeCompletion | ( | const NamedDecl & | ND, |
ASTContext & | ASTCtx | ||
) |
Definition at line 1650 of file CodeComplete.cpp.
|
static |
Definition at line 160 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
Definition at line 170 of file Quality.cpp.
bool clang::clangd::isLiteralInclude | ( | llvm::StringRef | Include | ) |
Returns true if Include
is literal include like "path" or <path>.
Definition at line 68 of file Headers.cpp.
Referenced by clang::clangd::HeaderFile::valid().
Definition at line 235 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Range::end, clang::clangd::Position::line, and clang::clangd::Range::start.
|
static |
Definition at line 36 of file Quality.cpp.
bool clang::clangd::isSpelledInSourceCode | ( | const Decl * | D | ) |
Definition at line 30 of file AST.cpp.
Referenced by isImplementationDetail().
|
static |
Definition at line 29 of file SourceCode.cpp.
Referenced by lspLength(), and measureUTF16().
xpc_object_t clang::clangd::jsonToXpc | ( | const llvm::json::Value & | JSON | ) |
xpc_object_t clang::clangd::jsonToXpc | ( | const json::Value & | JSON | ) |
Definition at line 21 of file Conversion.cpp.
Referenced by main().
|
static |
std::unique_ptr< SymbolIndex > clang::clangd::loadIndex | ( | llvm::StringRef | SymbolFilename, |
bool | UseDex | ||
) |
Definition at line 551 of file Serialization.cpp.
Referenced by clang::clangd::IndexFileOut::IndexFileOut().
void clang::clangd::log | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 63 of file Logger.h.
References clang::clangd::Logger::Info, and clang::clangd::detail::log().
Referenced by clang::clangd::BackgroundIndex::BackgroundIndex(), clang::clangd::ParsedAST::build(), buildCompilerInvocation(), clang::clangd::URIDistance::distance(), clang::clangd::DirectoryBasedGlobalCompilationDatabase::getCompileCommand(), clang::clangd::StoreDiags::HandleDiagnostic(), and clang::clangd::ClangdLSPServer::MessageHandler::onNotify().
|
static |
|
static |
Definition at line 69 of file FuzzyMatch.cpp.
Referenced by calculateRoles(), clang::clangd::FuzzyMatcher::FuzzyMatcher(), and clang::tidy::bugprone::isLikelyTypo().
size_t clang::clangd::lspLength | ( | StringRef | Code | ) |
size_t clang::clangd::lspLength | ( | llvm::StringRef | Code | ) |
Definition at line 70 of file SourceCode.cpp.
References iterateCodepoints().
Referenced by offsetToPosition().
|
static |
Definition at line 56 of file SourceCode.cpp.
References iterateCodepoints(), and Result.
Referenced by positionToOffset().
Definition at line 119 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, clang::clangd::Symbol::References, clang::clangd::Symbol::ReturnType, clang::clangd::Symbol::Signature, and clang::clangd::Symbol::Type.
Referenced by clang::clangd::FileSymbols::buildIndex().
|
static |
Return a string representation (e.g.
"namespace ns1::ns2") of the named declaration ND
.
Definition at line 489 of file XRefs.cpp.
References Name, and printingPolicyForDecls().
Referenced by getScopeName().
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 293 of file JSONTransport.cpp.
std::unique_ptr<Transport> clang::clangd::newXPCTransport | ( | ) |
Definition at line 212 of file XPCTransport.cpp.
std::pair< size_t, size_t > clang::clangd::offsetToClangLineColumn | ( | llvm::StringRef | Code, |
size_t | Offset | ||
) |
Definition at line 153 of file SourceCode.cpp.
References Lines.
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 116 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, Lines, lspLength(), and Pos.
Referenced by replacementToEdit().
|
inline |
Definition at line 141 of file Index.h.
References operator<<().
Definition at line 363 of file Index.h.
References operator<<().
|
inline |
Definition at line 79 of file Index.h.
References clang::clangd::SymbolLocation::Position::column(), and clang::clangd::SymbolLocation::Position::line().
|
inline |
Definition at line 89 of file Index.h.
References clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, operator<<(), and clang::clangd::SymbolLocation::Start.
Definition at line 378 of file Index.h.
References clang::clangd::Ref::Kind, and clang::clangd::Ref::Location.
bool clang::clangd::operator< | ( | const CompletionItem & | L, |
const CompletionItem & | R | ||
) |
Definition at line 686 of file Protocol.cpp.
References clang::clangd::CompletionItem::label, and clang::clangd::CompletionItem::sortText.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolLocation & | L | ||
) |
Definition at line 37 of file Index.cpp.
References clang::clangd::SymbolLocation::Position::column(), clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, clang::clangd::SymbolLocation::Position::line(), and clang::clangd::SymbolLocation::Start.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
SymbolOrigin | O | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolID & | ID | ||
) |
Definition at line 47 of file SymbolID.cpp.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
Symbol::SymbolFlag | F | ||
) |
Definition at line 54 of file Index.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, |
const Symbol & | S | ||
) |
Definition at line 65 of file Index.cpp.
References clang::clangd::Symbol::Name, and clang::clangd::Symbol::Scope.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const URIForFile & | U | ||
) |
Definition at line 79 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Position & | P | ||
) |
Definition at line 104 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
RefKind | K | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Range & | R | ||
) |
Definition at line 120 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 Location & | L | ||
) |
Definition at line 131 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 Ref & | R | ||
) |
Definition at line 131 of file Index.cpp.
References clang::clangd::Ref::Kind, and clang::clangd::Ref::Location.
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
SymbolOrigin | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const TextEdit & | TE | ||
) |
Definition at line 153 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 Inclusion & | Inc | ||
) |
Definition at line 177 of file Headers.cpp.
References clang::clangd::Inclusion::R, clang::clangd::Inclusion::Resolved, and clang::clangd::Inclusion::Written.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const DiagBase & | D | ||
) |
Definition at line 191 of file Diagnostics.cpp.
References clang::clangd::Range::end, clang::clangd::DiagBase::File, clang::clangd::DiagBase::InsideMainFile, clang::clangd::DiagBase::Message, clang::clangd::DiagBase::Range, and clang::clangd::Range::start.
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
const CodeCompletion & | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Fix & | F | ||
) |
Definition at line 200 of file Diagnostics.cpp.
References clang::clangd::Fix::Message.
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
const CodeCompleteResult & | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diag & | D | ||
) |
Definition at line 210 of file Diagnostics.cpp.
References D, and clang::clangd::Diag::Notes.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolQualitySignals & | S | ||
) |
Definition at line 251 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Category, clang::clangd::SymbolQualitySignals::Deprecated, clang::clangd::SymbolQualitySignals::evaluate(), clang::clangd::SymbolQualitySignals::References, and clang::clangd::SymbolQualitySignals::ReservedName.
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | , |
Symbol::SymbolFlag | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diagnostic & | D | ||
) |
Definition at line 390 of file Protocol.cpp.
References clang::clangd::Diagnostic::message, clang::clangd::Diagnostic::range, and clang::clangd::Diagnostic::severity.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolRelevanceSignals & | S | ||
) |
Definition at line 400 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::Context, clang::clangd::SymbolRelevanceSignals::evaluate(), clang::clangd::SymbolRelevanceSignals::FileProximityMatch, clang::clangd::SymbolRelevanceSignals::Forbidden, clang::clangd::SymbolRelevanceSignals::HadContextType, clang::clangd::SymbolRelevanceSignals::HadSymbolType, clang::clangd::SymbolRelevanceSignals::IsInstanceMember, clang::clangd::SymbolRelevanceSignals::NameMatch, clang::clangd::SymbolRelevanceSignals::NeedsFixIts, clang::clangd::SymbolRelevanceSignals::Query, clang::clangd::SymbolRelevanceSignals::Scope, scopeBoost(), clang::clangd::SymbolRelevanceSignals::ScopeProximityMatch, clang::clangd::SymbolRelevanceSignals::SemaFileProximityScore, clang::clangd::SymbolRelevanceSignals::SemaSaysInScope, clang::clangd::SymbolRelevanceSignals::SymbolScope, clang::clangd::SymbolRelevanceSignals::SymbolURI, clang::clangd::SymbolRelevanceSignals::TypeMatchesPreferred, and uriProximity().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SymbolInformation & | SI | ||
) |
Definition at line 447 of file Protocol.cpp.
References clang::clangd::SymbolInformation::containerName, clang::clangd::SymbolInformation::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SignatureQualitySignals & | S | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SymbolDetails & | S | ||
) |
Definition at line 480 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 DocumentSymbol & | S | ||
) |
Definition at line 519 of file Protocol.cpp.
References clang::clangd::DocumentSymbol::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const IndexFileOut & | O | ||
) |
Definition at line 528 of file Serialization.cpp.
References clang::clangd::IndexFileOut::Format, RIFF, writeYAML(), and YAML.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const CompletionItem & | I | ||
) |
Definition at line 681 of file Protocol.cpp.
References clang::clangd::CompletionItem::label, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const SignatureInformation & | I | ||
) |
Definition at line 717 of file Protocol.cpp.
References clang::clangd::SignatureInformation::label, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const DocumentHighlight & | V | ||
) |
Definition at line 755 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 & | OS, |
const CodeCompletion & | C | ||
) |
Definition at line 1719 of file CodeComplete.cpp.
References clang::clangd::CodeCompletion::render().
Referenced by clang::clangd::Range::contains(), clang::clangd::IndexFileOut::IndexFileOut(), operator &(), clang::clangd::LSPDiagnosticCompare::operator()(), operator<(), clang::clangd::TextEdit::operator==(), operator==(), and operator|=().
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const CodeCompleteResult & | R | ||
) |
Definition at line 1724 of file CodeComplete.cpp.
References clang::clangd::CodeCompleteResult::Completions, clang::clangd::CodeCompleteResult::Context, and clang::clangd::CodeCompleteResult::HasMore.
|
inline |
Definition at line 74 of file Index.h.
References clang::clangd::SymbolLocation::Position::column(), and clang::clangd::SymbolLocation::Position::line().
|
inline |
Definition at line 84 of file Index.h.
References clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, and clang::clangd::SymbolLocation::Start.
Definition at line 381 of file Index.h.
References clang::clangd::Ref::Kind, clang::clangd::Ref::Location, and operator<<().
bool clang::clangd::operator== | ( | const SymbolDetails & | LHS, |
const SymbolDetails & | RHS | ||
) |
Definition at line 453 of file Protocol.cpp.
References clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::ID, clang::clangd::SymbolDetails::name, and clang::clangd::SymbolDetails::USR.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 255 of file Index.h.
References operator<<().
|
static |
Definition at line 87 of file Index.cpp.
References visitStrings().
|
static |
Definition at line 152 of file FuzzyMatch.cpp.
|
static |
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 81 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and measureUTF16().
Referenced by clang::clangd::ClangdServer::formatOnType(), and speculateCompletionFilter().
std::unique_ptr<CompilerInstance> clang::clangd::prepareCompilerInstance | ( | std::unique_ptr< clang::CompilerInvocation > | CI, |
const PrecompiledPreamble * | Preamble, | ||
std::unique_ptr< llvm::MemoryBuffer > | Buffer, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
DiagnosticConsumer & | DiagsClient | ||
) |
Definition at line 44 of file Compiler.cpp.
Referenced by clang::clangd::ParsedAST::build().
std::unique_ptr<CompilerInstance> clang::clangd::prepareCompilerInstance | ( | std::unique_ptr< clang::CompilerInvocation > | , |
const PrecompiledPreamble * | , | ||
std::unique_ptr< llvm::MemoryBuffer > | MainFile, | ||
std::shared_ptr< PCHContainerOperations > | , | ||
IntrusiveRefCntPtr< llvm::vfs::FileSystem > | , | ||
DiagnosticConsumer & | |||
) |
Creates a compiler instance, configured so that:
MainFile
.MainFile
.
|
static |
Referenced by main().
void clang::clangd::preventThreadStarvationInTests | ( | ) |
Definition at line 142 of file Threading.cpp.
Referenced by main().
|
static |
Definition at line 460 of file XRefs.cpp.
Referenced by getHoverContents(), namedDeclQualifiedName(), and typeDeclToString().
std::string clang::clangd::printName | ( | const ASTContext & | Ctx, |
const NamedDecl & | ND | ||
) |
std::string clang::clangd::printNamespaceScope | ( | const DeclContext & | DC | ) |
Returns the first enclosing namespace scope starting from DC
.
Definition at line 109 of file AST.cpp.
References Ctx, and printQualifiedName().
std::string clang::clangd::printQualifiedName | ( | const NamedDecl & | ND | ) |
Returns the qualified name of ND.
The scope doesn't contain unwritten scopes like inline namespaces.
Definition at line 54 of file AST.cpp.
Referenced by printNamespaceScope().
float clang::clangd::quality | ( | const Symbol & | S | ) |
Definition at line 69 of file Index.cpp.
References clang::clangd::detail::log(), and clang::clangd::Symbol::References.
Referenced by visitStrings().
llvm::Expected< IndexFileIn > clang::clangd::readIndexFile | ( | llvm::StringRef | Data | ) |
Definition at line 540 of file Serialization.cpp.
References clang::clangd::riff::makeError(), readYAML(), and clang::tidy::cppcoreguidelines::toString().
llvm::Expected< IndexFileIn > clang::clangd::readYAML | ( | llvm::StringRef | Data | ) |
Definition at line 310 of file YAMLSerialization.cpp.
Referenced by readIndexFile().
std::vector<TextEdit> clang::clangd::replacementsToEdits | ( | StringRef | Code, |
const tooling::Replacements & | Repls | ||
) |
std::vector<TextEdit> clang::clangd::replacementsToEdits | ( | llvm::StringRef | Code, |
const tooling::Replacements & | Repls | ||
) |
Definition at line 179 of file SourceCode.cpp.
TextEdit clang::clangd::replacementToEdit | ( | StringRef | Code, |
const tooling::Replacement & | R | ||
) |
TextEdit clang::clangd::replacementToEdit | ( | llvm::StringRef | Code, |
const tooling::Replacement & | R | ||
) |
Definition at line 171 of file SourceCode.cpp.
References offsetToPosition().
|
static |
Referenced by clang::clangd::ClangdServer::dynamicIndex().
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 228 of file TUScheduler.h.
References Action, clang::clangd::Context::clone(), Ctx, and clang::clangd::Context::current().
Referenced by clang::clangd::AsyncTaskRunner::wait().
|
static |
Referenced by main().
|
static |
Definition at line 329 of file Quality.cpp.
References D, clang::clangd::ScopeDistance::distance(), and clang::clangd::FileDistance::Unreachable.
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
|
static |
Definition at line 180 of file FileDistance.cpp.
References clang::tidy::cppcoreguidelines::join().
Referenced by clang::clangd::ScopeDistance::distance().
void clang::clangd::setCurrentThreadPriority | ( | ThreadPriority | Priority | ) |
Definition at line 118 of file Threading.cpp.
References Low.
Referenced by clang::clangd::BackgroundIndex::stop().
|
static |
SignatureHelp clang::clangd::signatureHelp | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
const PreambleData * | Preamble, | ||
StringRef | Contents, | ||
Position | Pos, | ||
IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
const SymbolIndex * | Index | ||
) |
Get signature help at a specified Pos
in FileName
.
SignatureHelp clang::clangd::signatureHelp | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
const PreambleData * | Preamble, | ||
llvm::StringRef | Contents, | ||
Position | Pos, | ||
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
const SymbolIndex * | Index | ||
) |
Definition at line 1628 of file CodeComplete.cpp.
References Command, Contents, FileName, Pos, Preamble, and Result.
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 452 of file Quality.cpp.
References encodeFloat(), Lower, and Name.
Referenced by clang::clangd::TopN< T, Compare >::items().
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 128 of file SourceCode.cpp.
llvm::Expected< llvm::StringRef > clang::clangd::speculateCompletionFilter | ( | llvm::StringRef | Content, |
Position | Pos | ||
) |
Retrives a speculative code completion filter text before the cursor.
Exposed for testing only.
Definition at line 1592 of file CodeComplete.cpp.
References positionToOffset().
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.
Definition at line 164 of file SourceCode.cpp.
References Pos.
|
static |
Referenced by main().
Deadline clang::clangd::timeoutSeconds | ( | llvm::Optional< double > | Seconds | ) |
Makes a deadline from a timeout in seconds. None means wait forever.
Definition at line 99 of file Threading.cpp.
References clang::clangd::Deadline::infinity().
Referenced by clang::clangd::BackgroundIndex::blockUntilIdleForTest(), clang::clangd::ClangdServer::blockUntilIdleForTest(), and clang::clangd::Deadline::operator==().
CodeAction clang::clangd::toCodeAction | ( | const Fix & | F, |
const URIForFile & | File | ||
) |
Convert from Fix to LSP CodeAction.
Definition at line 232 of file Diagnostics.cpp.
References Action, clang::clangd::CodeAction::edit, clang::clangd::Fix::Edits, clang::clangd::CodeAction::kind, clang::clangd::Fix::Message, clang::clangd::CodeAction::QUICKFIX_KIND, clang::clangd::CodeAction::title, and clang::clangd::URIForFile::uri().
Referenced by asCommand().
llvm::json::Value clang::clangd::toJSON | ( | const URIForFile & | U | ) |
Serialize/deserialize URIForFile
to/from a string URI.
Definition at line 77 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
llvm::json::Value clang::clangd::toJSON | ( | const TextDocumentIdentifier & | R | ) |
Definition at line 83 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
llvm::json::Value clang::clangd::toJSON | ( | const Position & | P | ) |
Definition at line 97 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
llvm::json::Value clang::clangd::toJSON | ( | const Range & | P | ) |
Definition at line 113 of file Protocol.cpp.
References clang::clangd::Range::end, and clang::clangd::Range::start.
llvm::json::Value clang::clangd::toJSON | ( | const Location & | P | ) |
Definition at line 124 of file Protocol.cpp.
References clang::clangd::Location::range, and clang::clangd::Location::uri.
llvm::json::Value clang::clangd::toJSON | ( | const TextEdit & | P | ) |
Definition at line 146 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
llvm::json::Value clang::clangd::toJSON | ( | const FuzzyFindRequest & | Request | ) |
Definition at line 189 of file Index.cpp.
References clang::clangd::FuzzyFindRequest::AnyScope, clang::clangd::FuzzyFindRequest::Limit, clang::clangd::FuzzyFindRequest::ProximityPaths, clang::clangd::FuzzyFindRequest::Query, clang::clangd::FuzzyFindRequest::RestrictForCodeCompletion, and clang::clangd::FuzzyFindRequest::Scopes.
Referenced by clang::clangd::Range::contains(), clang::clangd::FuzzyFindRequest::operator!=(), operator<<(), clang::clangd::TextEdit::operator==(), and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const FormattingOptions & | P | ) |
Definition at line 330 of file Protocol.cpp.
References clang::clangd::FormattingOptions::insertSpaces, and clang::clangd::FormattingOptions::tabSize.
llvm::json::Value clang::clangd::toJSON | ( | const Diagnostic & | D | ) |
Definition at line 363 of file Protocol.cpp.
References clang::clangd::Diagnostic::category, clang::clangd::Diagnostic::codeActions, clang::clangd::Diagnostic::message, clang::clangd::Diagnostic::range, and clang::clangd::Diagnostic::severity.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolInformation & | P | ) |
Definition at line 438 of file Protocol.cpp.
References clang::clangd::SymbolInformation::containerName, clang::clangd::SymbolInformation::kind, clang::clangd::SymbolInformation::location, and clang::clangd::SymbolInformation::name.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolDetails & | P | ) |
Definition at line 458 of file Protocol.cpp.
References clang::clangd::SymbolDetails::containerName, clang::clangd::SymbolDetails::ID, clang::clangd::SymbolDetails::name, and clang::clangd::SymbolDetails::USR.
llvm::json::Value clang::clangd::toJSON | ( | const Command & | C | ) |
Definition at line 497 of file Protocol.cpp.
References clang::clangd::CodeAction::QUICKFIX_KIND.
llvm::json::Value clang::clangd::toJSON | ( | const CodeAction & | CA | ) |
Definition at line 506 of file Protocol.cpp.
References clang::clangd::CodeAction::command, clang::clangd::CodeAction::diagnostics, clang::clangd::CodeAction::edit, clang::clangd::CodeAction::kind, and clang::clangd::CodeAction::title.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentSymbol & | S | ) |
Definition at line 523 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, Result, and clang::clangd::DocumentSymbol::selectionRange.
llvm::json::Value clang::clangd::toJSON | ( | const WorkspaceEdit & | WE | ) |
Definition at line 539 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changes.
llvm::json::Value clang::clangd::toJSON | ( | const ApplyWorkspaceEditParams & | Params | ) |
Definition at line 548 of file Protocol.cpp.
References clang::clangd::ApplyWorkspaceEditParams::edit.
llvm::json::Value clang::clangd::toJSON | ( | const MarkupContent & | MC | ) |
Definition at line 591 of file Protocol.cpp.
References clang::clangd::MarkupContent::kind, toTextKind(), and clang::clangd::MarkupContent::value.
llvm::json::Value clang::clangd::toJSON | ( | const Hover & | H | ) |
Definition at line 601 of file Protocol.cpp.
References clang::clangd::Hover::contents, clang::clangd::Hover::range, Result, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const CompletionItem & | CI | ) |
Definition at line 655 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, Missing, Result, clang::clangd::CompletionItem::sortText, and clang::clangd::CompletionItem::textEdit.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionList & | L | ) |
Definition at line 691 of file Protocol.cpp.
References clang::clangd::CompletionList::isIncomplete, and clang::clangd::CompletionList::items.
llvm::json::Value clang::clangd::toJSON | ( | const ParameterInformation & | PI | ) |
Definition at line 698 of file Protocol.cpp.
References clang::clangd::ParameterInformation::documentation, clang::clangd::ParameterInformation::label, and Result.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureInformation & | SI | ) |
Definition at line 706 of file Protocol.cpp.
References clang::clangd::SignatureInformation::documentation, clang::clangd::SignatureInformation::label, clang::clangd::SignatureInformation::parameters, and Result.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureHelp & | SH | ) |
Definition at line 723 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 DocumentHighlight & | DH | ) |
Definition at line 741 of file Protocol.cpp.
References clang::clangd::DocumentHighlight::kind, clang::clangd::DocumentHighlight::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const FileStatus & | FStatus | ) |
Definition at line 748 of file Protocol.cpp.
References clang::clangd::FileStatus::state, and clang::clangd::FileStatus::uri.
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 242 of file Diagnostics.cpp.
TextEdit clang::clangd::toTextEdit | ( | const FixItHint & | FixIt, |
const SourceManager & | M, | ||
const LangOptions & | L | ||
) |
Definition at line 226 of file SourceCode.cpp.
References halfOpenToRange(), clang::clangd::TextEdit::newText, clang::clangd::TextEdit::range, and Result.
Referenced by clang::clangd::StoreDiags::HandleDiagnostic().
|
static |
Definition at line 581 of file Protocol.cpp.
References Markdown, and PlainText.
Referenced by toJSON().
std::string clang::clangd::toYAML | ( | const Symbol & | S | ) |
Definition at line 338 of file YAMLSerialization.cpp.
Referenced by clang::clangd::IndexFileOut::IndexFileOut().
Definition at line 349 of file YAMLSerialization.cpp.
|
static |
Return a string representation (e.g.
"class MyNamespace::MyClass") of the type declaration TD
.
Definition at line 474 of file XRefs.cpp.
References Name, and printingPolicyForDecls().
Referenced by getScopeName().
|
static |
Definition at line 320 of file Quality.cpp.
References clang::clangd::URIDistance::distance(), and clang::tidy::bugprone::f().
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
|
static |
Referenced by clang::clangd::IndexFileOut::IndexFileOut().
Definition at line 263 of file Index.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, quality(), clang::clangd::Symbol::ReturnType, clang::clangd::Symbol::Scope, clang::clangd::Symbol::Signature, and clang::clangd::Symbol::Type.
Referenced by own().
void clang::clangd::vlog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 68 of file Logger.h.
References clang::clangd::detail::log(), and clang::clangd::Logger::Verbose.
Referenced by buildPreamble().
LLVM_NODISCARD bool clang::clangd::wait | ( | std::unique_lock< std::mutex > & | Lock, |
std::condition_variable & | CV, | ||
Deadline | D, | ||
Func | F | ||
) |
Waits on a condition variable until F() is true or D expires.
Definition at line 92 of file Threading.h.
References clang::clangd::Deadline::expired(), and clang::clangd::Notification::wait().
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 107 of file Threading.cpp.
References clang::clangd::Deadline::infinity(), clang::clangd::Deadline::time(), and clang::clangd::Deadline::zero().
Referenced by clang::clangd::BackgroundIndex::blockUntilIdleForTest(), clang::clangd::AsyncTaskRunner::wait(), and clang::clangd::AsyncTaskRunner::~AsyncTaskRunner().
|
static |
Referenced by main().
void clang::clangd::writeYAML | ( | const IndexFileOut & | O, |
llvm::raw_ostream & | OS | ||
) |
Definition at line 295 of file YAMLSerialization.cpp.
References clang::clangd::IndexFileOut::Refs, and clang::clangd::IndexFileOut::Symbols.
Referenced by operator<<().
llvm::json::Value clang::clangd::xpcToJson | ( | const xpc_object_t & | XPCObject | ) |
Definition at line 27 of file Conversion.cpp.
References elog(), and clang::tidy::cppcoreguidelines::toString().
Referenced by dumpXPCObject().
|
static |
Definition at line 116 of file Threading.cpp.
|
static |
Definition at line 73 of file FuzzyMatch.cpp.
Referenced by calculateRoles(), and clang::clangd::FuzzyMatcher::FuzzyMatcher().
|
static |
Definition at line 142 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
|
static |
Definition at line 115 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
constexpr auto clang::clangd::CompletionItemKindMax |
Definition at line 290 of file Protocol.h.
constexpr auto clang::clangd::CompletionItemKindMin |
Definition at line 288 of file Protocol.h.
Referenced by adjustKindToCapability().
|
static |
Definition at line 17 of file Cancellation.cpp.
|
static |
Definition at line 67 of file TUScheduler.cpp.
|
static |
Definition at line 75 of file FuzzyMatch.cpp.
constexpr auto clang::clangd::SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
Definition at line 329 of file Protocol.h.
constexpr auto clang::clangd::SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
Definition at line 328 of file Protocol.h.
Referenced by adjustKindToCapability().