clang-tools
7.0.0
|
Namespaces | |
detail | |
dex | |
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 | CachingCompilationDb |
A wrapper around GlobalCompilationDatabase that caches the compile commands. More... | |
class | CanonicalIncludes |
Maps a definition location onto an #include file, based on a set of filename rules. More... | |
struct | ClangdConfigurationParamsChange |
Clangd extension to set clangd-specific "initializationOptions" in the "initialize" request and for the "workspace/didChangeConfiguration" notification since the data received is described as 'any' type in LSP. More... | |
struct | ClangdInitializationOptions |
class | ClangdLSPServer |
This class provides implementation of an LSP server, glueing the JSON dispatch and ClangdServer together. More... | |
class | ClangdServer |
Provides API to manage ASTs for a collection of C++ files and request various language features. More... | |
struct | ClientCapabilities |
struct | CodeActionContext |
struct | CodeActionParams |
class | CodeCompleteFlow |
struct | CodeCompleteOptions |
struct | CodeCompleteResult |
struct | CodeCompletion |
struct | Command |
struct | CompletionClientCapabilities |
struct | CompletionItem |
struct | CompletionItemClientCapabilities |
struct | CompletionList |
Represents a collection of completion items to be presented in the editor. 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 | DocumentSymbolParams |
class | DraftStore |
A thread-safe container for files opened in a workspace, addressed by filenames. 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 symbls from files and an in-memory index on all symbols. 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 |
class | IncludeInserter |
class | IncludeStructure |
struct | Inclusion |
struct | InitializeParams |
struct | InputsAndAST |
struct | InputsAndPreamble |
class | JSONOutput |
Encapsulates output and logs streams and provides thread-safe access to them. More... | |
class | JSONRPCDispatcher |
Main JSONRPC entry point. More... | |
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... | |
struct | MarkupContent |
class | MemIndex |
This implements an index for a (relatively small) set of symbols that can be easily managed in memory. More... | |
struct | Metadata |
struct | NoParams |
struct | Note |
Represents a note for the diagnostic. More... | |
class | Notification |
A threadsafe flag that is initially clear. More... | |
struct | ParameterInformation |
A single parameter of a particular signature. More... | |
class | ParsedAST |
Stores and provides access to parsed AST. More... | |
struct | ParseInputs |
Information required to run clang, e.g. to parse AST or do code completion. More... | |
struct | Position |
struct | PreambleData |
class | ProtocolCallbacks |
struct | Range |
class | RealFileSystemProvider |
struct | RenameParams |
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 | SourceParams |
class | StoreDiags |
StoreDiags collects the diagnostics that can later be reported by clangd. More... | |
struct | Symbol |
class | SymbolCollector |
Collect declarations (symbols) from an AST. 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 | SymbolKindCapabilities |
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 | TextDocumentClientCapabilities |
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 | TUScheduler |
Handles running tasks for ClangdServer and managing the resources (e.g., preambles and ASTs) for opened files. More... | |
class | URI |
A URI describes the location of a source file. More... | |
class | URIDistance |
struct | URIForFile |
class | URIScheme |
URIScheme is an extension point for teaching clangd to recognize a custom URI scheme. More... | |
class | WithContext |
WithContext replaces Context::current() with a provided scope. More... | |
class | WithContextValue |
WithContextValue extends Context::current() with a single value. More... | |
struct | WorkspaceClientCapabilities |
struct | WorkspaceEdit |
struct | WorkspaceSymbolCapabilities |
struct | WorkspaceSymbolParams |
The parameters of a Workspace Symbol Request. More... | |
Typedefs | |
using | PreambleParsedCallback = std::function< void(PathRef Path, 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 | 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 | SymbolKindBitset = std::bitset< SymbolKindMax+1 > |
typedef llvm::Registry< URIScheme > | URISchemeRegistry |
By default, a "file" scheme is supported where URI paths are always absolute in the file system. More... | |
Functions | |
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... | |
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... | |
void | dumpAST (ParsedAST &AST, llvm::raw_ostream &OS) |
For testing/debugging purposes. More... | |
CodeCompleteResult | codeComplete (PathRef FileName, const tooling::CompileCommand &Command, PrecompiledPreamble const *Preamble, const IncludeStructure &PreambleInclusions, StringRef Contents, Position Pos, IntrusiveRefCntPtr< vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, CodeCompleteOptions Opts) |
Get code completions at a specified Pos in FileName . More... | |
SignatureHelp | signatureHelp (PathRef FileName, const tooling::CompileCommand &Command, PrecompiledPreamble const *Preamble, StringRef Contents, Position Pos, IntrusiveRefCntPtr< vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs) |
Get signature help at a specified Pos in FileName . More... | |
bool | isIndexedForCodeCompletion (const NamedDecl &ND, ASTContext &ASTCtx) |
raw_ostream & | operator<< (raw_ostream &OS, const CodeCompletion &C) |
raw_ostream & | operator<< (raw_ostream &OS, const CodeCompleteResult &R) |
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 | getParameterDocComment (const ASTContext &Ctx, const CodeCompleteConsumer::OverloadCandidate &Result, unsigned ArgIndex, bool CommentsFromHeaders) |
Gets a minimally formatted documentation for parameter of Result , corresponding to argument number ArgIndex . 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 >, const PrecompiledPreamble *, std::unique_ptr< llvm::MemoryBuffer > MainFile, std::shared_ptr< PCHContainerOperations >, IntrusiveRefCntPtr< 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) |
void | toLSPDiags (const Diag &D, 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 SmallString< 128 > | canonicalize (StringRef Path) |
llvm::Expected< std::vector< SymbolInformation > > | getWorkspaceSymbols (StringRef Query, int Limit, const SymbolIndex *const Index, StringRef HintPath) |
llvm::Expected< std::vector< SymbolInformation > > | getDocumentSymbols (ParsedAST &AST) |
Retrieves the symbols contained in the "main file" section of an AST in the same order that they appear. More... | |
llvm::Expected< std::vector< SymbolInformation > > | getWorkspaceSymbols (llvm::StringRef Query, int Limit, const SymbolIndex *const Index, llvm::StringRef HintPath) |
Searches for the symbols matching Query . More... | |
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 (StringRef Text, MutableArrayRef< CharRole > Roles) |
CharTypeSet | calculateRoles (llvm::StringRef Text, llvm::MutableArrayRef< CharRole > Roles) |
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... | |
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... | |
SymbolSlab | indexAST (ASTContext &AST, std::shared_ptr< Preprocessor > PP, llvm::ArrayRef< std::string > URISchemes={}) |
Retrieves namespace and class level symbols in AST . More... | |
raw_ostream & | operator<< (raw_ostream &OS, const SymbolLocation &L) |
raw_ostream & | operator<< (raw_ostream &OS, const SymbolID &ID) |
void | operator>> (StringRef Str, SymbolID &ID) |
raw_ostream & | operator<< (raw_ostream &OS, SymbolOrigin O) |
raw_ostream & | operator<< (raw_ostream &OS, const Symbol &S) |
double | quality (const Symbol &S) |
static void | own (Symbol &S, DenseSet< StringRef > &Strings, BumpPtrAllocator &Arena) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &, const SymbolLocation &) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const SymbolID &ID) |
void | operator>> (llvm::StringRef HexStr, SymbolID &ID) |
SymbolOrigin | operator| (SymbolOrigin A, SymbolOrigin B) |
SymbolOrigin & | operator|= (SymbolOrigin &A, SymbolOrigin B) |
SymbolOrigin | operator & (SymbolOrigin A, SymbolOrigin B) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Symbol &S) |
Symbol | mergeSymbol (const Symbol &L, const Symbol &R, Symbol::Details *Scratch) |
std::unique_ptr< SymbolIndex > | mergeIndex (const SymbolIndex *Dynamic, const SymbolIndex *Static) |
SymbolSlab | symbolsFromYAML (llvm::StringRef YAMLContent) |
Symbol | SymbolFromYAML (llvm::yaml::Input &Input, llvm::BumpPtrAllocator &Arena) |
void | SymbolsToYAML (const SymbolSlab &Symbols, llvm::raw_ostream &OS) |
std::string | SymbolToYAML (Symbol Sym) |
void | reply (llvm::json::Value &&Result) |
Sends a successful reply. More... | |
void | replyError (ErrorCode Code, const llvm::StringRef &Message) |
Sends an error response to the client, and logs it. More... | |
void | call (llvm::StringRef Method, llvm::json::Value &&Params) |
Sends a request to the client. More... | |
void | runLanguageServerLoop (std::FILE *In, JSONOutput &Out, JSONStreamStyle InputStyle, JSONRPCDispatcher &Dispatcher, bool &IsDone) |
Parses input queries from LSP client (coming from In ) and runs call method of Dispatcher for each query. More... | |
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 json::Value &E, URIForFile &R) |
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) |
json::Value | toJSON (const TextDocumentIdentifier &R) |
bool | fromJSON (const json::Value &Params, TextDocumentIdentifier &R) |
bool | fromJSON (const json::Value &Params, Position &R) |
json::Value | toJSON (const Position &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Position &P) |
bool | fromJSON (const json::Value &Params, Range &R) |
json::Value | toJSON (const Range &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Range &R) |
json::Value | toJSON (const Location &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Location &L) |
bool | fromJSON (const json::Value &Params, TextDocumentItem &R) |
bool | fromJSON (const json::Value &Params, Metadata &R) |
bool | fromJSON (const json::Value &Params, TextEdit &R) |
json::Value | toJSON (const TextEdit &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const TextEdit &TE) |
bool | fromJSON (const json::Value &E, TraceLevel &Out) |
bool | fromJSON (const json::Value &Params, CompletionItemClientCapabilities &R) |
bool | fromJSON (const json::Value &Params, CompletionClientCapabilities &R) |
bool | fromJSON (const json::Value &E, SymbolKind &Out) |
bool | fromJSON (const json::Value &E, std::vector< SymbolKind > &Out) |
bool | fromJSON (const json::Value &Params, SymbolKindCapabilities &R) |
SymbolKind | adjustKindToCapability (SymbolKind Kind, SymbolKindBitset &SupportedSymbolKinds) |
bool | fromJSON (const json::Value &Params, WorkspaceSymbolCapabilities &R) |
bool | fromJSON (const json::Value &Params, WorkspaceClientCapabilities &R) |
bool | fromJSON (const json::Value &Params, TextDocumentClientCapabilities &R) |
bool | fromJSON (const json::Value &Params, ClientCapabilities &R) |
bool | fromJSON (const json::Value &Params, InitializeParams &R) |
bool | fromJSON (const json::Value &Params, DidOpenTextDocumentParams &R) |
bool | fromJSON (const json::Value &Params, DidCloseTextDocumentParams &R) |
bool | fromJSON (const json::Value &Params, DidChangeTextDocumentParams &R) |
bool | fromJSON (const json::Value &E, FileChangeType &Out) |
bool | fromJSON (const json::Value &Params, FileEvent &R) |
bool | fromJSON (const json::Value &Params, DidChangeWatchedFilesParams &R) |
bool | fromJSON (const json::Value &Params, TextDocumentContentChangeEvent &R) |
bool | fromJSON (const json::Value &Params, FormattingOptions &R) |
json::Value | toJSON (const FormattingOptions &P) |
bool | fromJSON (const json::Value &Params, DocumentRangeFormattingParams &R) |
bool | fromJSON (const json::Value &Params, DocumentOnTypeFormattingParams &R) |
bool | fromJSON (const json::Value &Params, DocumentFormattingParams &R) |
bool | fromJSON (const json::Value &Params, DocumentSymbolParams &R) |
bool | fromJSON (const json::Value &Params, Diagnostic &R) |
bool | fromJSON (const json::Value &Params, CodeActionContext &R) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Diagnostic &D) |
bool | fromJSON (const json::Value &Params, CodeActionParams &R) |
bool | fromJSON (const json::Value &Params, WorkspaceEdit &R) |
bool | fromJSON (const json::Value &Params, ExecuteCommandParams &R) |
json::Value | toJSON (const SymbolInformation &P) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SymbolInformation &SI) |
bool | fromJSON (const json::Value &Params, WorkspaceSymbolParams &R) |
json::Value | toJSON (const Command &C) |
json::Value | toJSON (const WorkspaceEdit &WE) |
json::Value | toJSON (const ApplyWorkspaceEditParams &Params) |
bool | fromJSON (const json::Value &Params, TextDocumentPositionParams &R) |
static StringRef | toTextKind (MarkupKind Kind) |
json::Value | toJSON (const MarkupContent &MC) |
json::Value | toJSON (const Hover &H) |
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) |
json::Value | toJSON (const CompletionList &L) |
json::Value | toJSON (const ParameterInformation &PI) |
json::Value | toJSON (const SignatureInformation &SI) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const SignatureInformation &I) |
json::Value | toJSON (const SignatureHelp &SH) |
bool | fromJSON (const json::Value &Params, RenameParams &R) |
json::Value | toJSON (const DocumentHighlight &DH) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &O, const DocumentHighlight &V) |
bool | fromJSON (const json::Value &Params, DidChangeConfigurationParams &CCP) |
bool | fromJSON (const json::Value &Params, ClangdConfigurationParamsChange &CCPC) |
bool | fromJSON (const llvm::json::Value &, URIForFile &) |
bool | fromJSON (const llvm::json::Value &, TextDocumentIdentifier &) |
bool | fromJSON (const llvm::json::Value &, Position &) |
bool | fromJSON (const llvm::json::Value &, Range &) |
bool | fromJSON (const llvm::json::Value &, Metadata &) |
bool | fromJSON (const llvm::json::Value &, TextEdit &) |
bool | fromJSON (const llvm::json::Value &, TextDocumentItem &) |
bool | fromJSON (const llvm::json::Value &E, TraceLevel &Out) |
bool | fromJSON (const llvm::json::Value &, NoParams &) |
bool | fromJSON (const llvm::json::Value &, CompletionItemClientCapabilities &) |
bool | fromJSON (const llvm::json::Value &, CompletionClientCapabilities &) |
bool | fromJSON (const llvm::json::Value &, SymbolKind &) |
bool | fromJSON (const llvm::json::Value &, std::vector< SymbolKind > &) |
bool | fromJSON (const llvm::json::Value &, SymbolKindCapabilities &) |
bool | fromJSON (const llvm::json::Value &, WorkspaceSymbolCapabilities &) |
bool | fromJSON (const llvm::json::Value &, WorkspaceClientCapabilities &) |
bool | fromJSON (const llvm::json::Value &, TextDocumentClientCapabilities &) |
bool | fromJSON (const llvm::json::Value &, ClientCapabilities &) |
bool | fromJSON (const llvm::json::Value &, ClangdConfigurationParamsChange &) |
bool | fromJSON (const llvm::json::Value &, InitializeParams &) |
bool | fromJSON (const llvm::json::Value &, DidOpenTextDocumentParams &) |
bool | fromJSON (const llvm::json::Value &, DidCloseTextDocumentParams &) |
bool | fromJSON (const llvm::json::Value &, TextDocumentContentChangeEvent &) |
bool | fromJSON (const llvm::json::Value &, DidChangeTextDocumentParams &) |
bool | fromJSON (const llvm::json::Value &E, FileChangeType &Out) |
bool | fromJSON (const llvm::json::Value &, FileEvent &) |
bool | fromJSON (const llvm::json::Value &, DidChangeWatchedFilesParams &) |
bool | fromJSON (const llvm::json::Value &, DidChangeConfigurationParams &) |
bool | fromJSON (const llvm::json::Value &, FormattingOptions &) |
bool | fromJSON (const llvm::json::Value &, DocumentRangeFormattingParams &) |
bool | fromJSON (const llvm::json::Value &, DocumentOnTypeFormattingParams &) |
bool | fromJSON (const llvm::json::Value &, DocumentFormattingParams &) |
bool | fromJSON (const llvm::json::Value &, DocumentSymbolParams &) |
bool | fromJSON (const llvm::json::Value &, Diagnostic &) |
bool | fromJSON (const llvm::json::Value &, CodeActionContext &) |
bool | fromJSON (const llvm::json::Value &, CodeActionParams &) |
bool | fromJSON (const llvm::json::Value &, WorkspaceEdit &) |
bool | fromJSON (const llvm::json::Value &, ExecuteCommandParams &) |
bool | fromJSON (const llvm::json::Value &, WorkspaceSymbolParams &) |
bool | fromJSON (const llvm::json::Value &, TextDocumentPositionParams &) |
bool | fromJSON (const llvm::json::Value &, RenameParams &) |
void | registerCallbackHandlers (JSONRPCDispatcher &Dispatcher, ProtocolCallbacks &Callbacks) |
static bool | isReserved (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) |
raw_ostream & | operator<< (raw_ostream &OS, const SymbolQualitySignals &S) |
static SymbolRelevanceSignals::AccessibleScope | computeScope (const NamedDecl *D) |
static std::pair< float, unsigned > | proximityScore (llvm::StringRef SymbolURI, URIDistance *D) |
raw_ostream & | operator<< (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 &, const SymbolQualitySignals &) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &, const SymbolRelevanceSignals &) |
template<typename Callback > | |
static bool | iterateCodepoints (StringRef U8, const Callback &CB) |
static size_t | measureUTF16 (StringRef U8, int U16Units, bool &Valid) |
static size_t | utf16Len (StringRef U8) |
llvm::Expected< size_t > | positionToOffset (StringRef Code, Position P, bool AllowColumnsBeyondLineLength) |
Position | offsetToPosition (StringRef Code, size_t Offset) |
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 (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 (StringRef Code, const tooling::Replacement &R) |
std::vector< TextEdit > | replacementsToEdits (StringRef Code, const tooling::Replacements &Repls) |
llvm::Optional< std::string > | getAbsoluteFilePath (const FileEntry *F, const SourceManager &SourceMgr) |
Get the absolute file path of a given file entry. More... | |
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... | |
std::pair< size_t, size_t > | offsetToClangLineColumn (llvm::StringRef Code, size_t Offset) |
Deadline | timeoutSeconds (llvm::Optional< double > Seconds) |
Makes a deadline from a timeout in seconds. None means wait forever. More... | |
void | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D) |
Wait once on CV for the specified duration. More... | |
template<typename Func > | |
LLVM_NODISCARD bool | wait (std::unique_lock< std::mutex > &Lock, std::condition_variable &CV, Deadline D, Func F) |
Waits on a condition variable until F() is true or D expires. More... | |
unsigned | getDefaultAsyncThreadsCount () |
Returns a number of a default async threads to use for TUScheduler. More... | |
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, 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 (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... | |
Optional< Hover > | getHover (ParsedAST &AST, Position Pos) |
Get the hover information when hovering at Pos . More... | |
Variables | |
static constexpr int | AwfulScore = -(1 << 13) |
static constexpr int | PerfectBonus = 3 |
static constexpr uint8_t | CharTypes [] |
static constexpr uint8_t | CharRoles [] |
constexpr auto | SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
constexpr auto | SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
using clang::clangd::Callback = typedef llvm::unique_function<void(llvm::Expected<T>)> |
A Callback<T> is a void function that accepts Expected<T>.
This is accepted by ClangdServer functions that logically return T.
Definition at line 28 of file Function.h.
using clang::clangd::CharTypeSet = typedef unsigned char |
Definition at line 50 of file FuzzyMatch.h.
using clang::clangd::ExitParams = typedef NoParams |
Definition at line 204 of file Protocol.h.
using clang::clangd::Path = typedef std::string |
using clang::clangd::PathRef = typedef llvm::StringRef |
using clang::clangd::PreambleParsedCallback = typedef std::function<void( PathRef Path, ASTContext &, std::shared_ptr<clang::Preprocessor>)> |
Definition at line 131 of file ClangdUnit.h.
using clang::clangd::ShutdownParams = typedef NoParams |
Definition at line 203 of file Protocol.h.
using clang::clangd::SymbolKindBitset = typedef std::bitset<SymbolKindMax + 1> |
Definition at line 278 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.
|
strong |
The kind of a completion entry.
Enumerator | |
---|---|
Missing | |
Text | |
Method | |
Function | |
Constructor | |
Field | |
Variable | |
Class | |
Interface | |
Module | |
Property | |
Unit | |
Value | |
Enum | |
Keyword | |
Snippet | |
Color | |
File | |
Reference |
Definition at line 644 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Text | |
Read | |
Write |
Definition at line 803 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
ParseError | |
InvalidRequest | |
MethodNotFound | |
InvalidParams | |
InternalError | |
ServerNotInitialized | |
UnknownErrorCode | |
RequestCancelled |
Definition at line 37 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Created | The file got created. |
Changed | The file got changed. |
Deleted | The file got deleted. |
Definition at line 412 of file Protocol.h.
|
strong |
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Definition at line 668 of file Protocol.h.
Controls the way JSON-RPC messages are encoded (both input and output).
Enumerator | |
---|---|
Standard | Encoding per the LSP specification, with mandatory Content-Length header. |
Delimited | Messages are delimited by a '—' line. Comment lines start with #. |
Definition at line 95 of file JSONRPCDispatcher.h.
|
strong |
Enumerator | |
---|---|
PlainText | |
Markdown |
Definition at line 622 of file Protocol.h.
|
strong |
A symbol kind.
Definition at line 247 of file Protocol.h.
|
strong |
|
strong |
Defines how the host (editor) should sync document changes to the language server.
Definition at line 208 of file Protocol.h.
|
strong |
Enumerator | |
---|---|
Off | |
Messages | |
Verbose |
Definition at line 194 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 38 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 102 of file CanonicalIncludes.cpp.
References clang::clangd::CanonicalIncludes::addRegexMapping(), and clang::clangd::CanonicalIncludes::addSymbolMapping().
SymbolKind clang::clangd::adjustKindToCapability | ( | SymbolKind | Kind, |
SymbolKindBitset & | SupportedSymbolKinds | ||
) |
Definition at line 210 of file Protocol.cpp.
References Class, Enum, EnumMember, Kind, String, Struct, and SymbolKindMin.
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 81 of file Function.h.
Referenced by clang::clangd::ClangdServer::documentSymbols(), clang::clangd::ClangdServer::dumpAST(), clang::clangd::ClangdServer::findDefinitions(), clang::clangd::ClangdServer::findDocumentHighlights(), clang::clangd::ClangdServer::findHover(), and clang::clangd::ClangdServer::signatureHelp().
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 357 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 267 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 294 of file ClangdUnit.cpp.
CharTypeSet clang::clangd::calculateRoles | ( | llvm::StringRef | Text, |
llvm::MutableArrayRef< CharRole > | Roles | ||
) |
CharTypeSet clang::clangd::calculateRoles | ( | StringRef | Text, |
MutableArrayRef< CharRole > | Roles | ||
) |
Definition at line 156 of file FuzzyMatch.cpp.
References AwfulScore, CharRoles, CharTypes, Empty, Head, Lower, lower(), Tail, and Upper.
Referenced by clang::clangd::FuzzyMatcher::FuzzyMatcher(), clang::clangd::dex::generateIdentifierTrigrams(), and clang::clangd::dex::generateQueryTrigrams().
void clang::clangd::call | ( | llvm::StringRef | Method, |
llvm::json::Value && | Params | ||
) |
Sends a request to the client.
Current context must derive from JSONRPCDispatcher::Handler.
Referenced by clang::clangd::JSONRPCDispatcher::JSONRPCDispatcher(), and replyError().
|
static |
Definition at line 48 of file FileDistance.cpp.
References clang::clangd::FileDistance::kUnreachable.
Referenced by clang::clangd::FileDistance::distance().
|
static |
Definition at line 57 of file Quality.cpp.
References Constructor, Function, MAP, Namespace, Unknown, and Variable.
Referenced by categorize(), and clang::clangd::SymbolQualitySignals::merge().
|
static |
Definition at line 82 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 108 of file Quality.cpp.
References clang::clangd::SymbolQualitySignals::Constructor, clang::clangd::SymbolQualitySignals::Function, clang::clangd::SymbolQualitySignals::Macro, clang::clangd::SymbolQualitySignals::Namespace, clang::clangd::SymbolQualitySignals::Type, clang::clangd::SymbolQualitySignals::Unknown, Unknown, and clang::clangd::SymbolQualitySignals::Variable.
CodeCompleteResult clang::clangd::codeComplete | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
PrecompiledPreamble const * | Preamble, | ||
const IncludeStructure & | PreambleInclusions, | ||
StringRef | Contents, | ||
Position | Pos, | ||
IntrusiveRefCntPtr< vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs, | ||
CodeCompleteOptions | Opts | ||
) |
Get code completions at a specified Pos
in FileName
.
Definition at line 1220 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 74 of file Headers.cpp.
Referenced by clang::clangd::ParsedAST::build().
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 77 of file CanonicalIncludes.cpp.
|
static |
Definition at line 244 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 23 of file Context.cpp.
References clang::clangd::Context::empty().
Referenced by clang::clangd::Context::current(), and clang::clangd::Context::swapCurrent().
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 119 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 56 of file Logger.h.
References clang::clangd::Logger::Error, and clang::clangd::detail::log().
Referenced by fromJSON(), clang::clangd::JSONOutput::mirrorInput(), clang::clangd::TUScheduler::remove(), replyError(), and clang::clangd::ClangdServer::setRootPath().
|
static |
Definition at line 373 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 367 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 216 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 391 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findDocumentHighlights().
SourceLocation clang::clangd::findNameLoc | ( | const clang::Decl * | D | ) |
Find the identifier source location of the given D.
The returned location is usually the spelling location where the name of the decl occurs in the code.
Definition at line 20 of file AST.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
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 166 of file CodeCompletionStrings.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
bool clang::clangd::fromJSON | ( | const json::Value & | E, |
URIForFile & | R | ||
) |
Definition at line 33 of file Protocol.cpp.
References elog(), log(), clang::clangd::URI::parse(), and clang::clangd::URI::resolve().
Referenced by clang::clangd::Range::contains(), and clang::clangd::LSPDiagnosticCompare::operator()().
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextDocumentIdentifier & | R | ||
) |
Definition at line 66 of file Protocol.cpp.
References clang::clangd::TextDocumentIdentifier::uri.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
Position & | R | ||
) |
Definition at line 71 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
URIForFile & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
TextDocumentIdentifier & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
Range & | R | ||
) |
Definition at line 87 of file Protocol.cpp.
References clang::clangd::Range::end, and clang::clangd::Range::start.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
Position & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextDocumentItem & | R | ||
) |
Definition at line 114 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 json::Value & | Params, |
Metadata & | R | ||
) |
Definition at line 120 of file Protocol.cpp.
References clang::clangd::Metadata::extraFlags.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextEdit & | R | ||
) |
Definition at line 128 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, and clang::clangd::TextEdit::range.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
Range & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | E, |
TraceLevel & | Out | ||
) |
Definition at line 146 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
CompletionItemClientCapabilities & | R | ||
) |
Definition at line 162 of file Protocol.cpp.
References clang::clangd::CompletionItemClientCapabilities::commitCharacterSupport, and clang::clangd::CompletionItemClientCapabilities::snippetSupport.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
Metadata & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
CompletionClientCapabilities & | R | ||
) |
Definition at line 171 of file Protocol.cpp.
References clang::clangd::CompletionClientCapabilities::completionItem, clang::clangd::CompletionClientCapabilities::contextSupport, and clang::clangd::CompletionClientCapabilities::dynamicRegistration.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
TextEdit & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | E, |
SymbolKind & | Out | ||
) |
Definition at line 181 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
TextDocumentItem & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | E, |
std::vector< SymbolKind > & | Out | ||
) |
Definition at line 192 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
TraceLevel & | Out | ||
) |
|
inline |
Definition at line 202 of file Protocol.h.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
SymbolKindCapabilities & | R | ||
) |
Definition at line 205 of file Protocol.cpp.
References clang::clangd::SymbolKindCapabilities::valueSet.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
WorkspaceSymbolCapabilities & | R | ||
) |
Definition at line 228 of file Protocol.cpp.
References clang::clangd::WorkspaceSymbolCapabilities::symbolKind.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
CompletionItemClientCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
WorkspaceClientCapabilities & | R | ||
) |
Definition at line 233 of file Protocol.cpp.
References clang::clangd::WorkspaceClientCapabilities::symbol.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextDocumentClientCapabilities & | R | ||
) |
Definition at line 238 of file Protocol.cpp.
References clang::clangd::TextDocumentClientCapabilities::completion.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
CompletionClientCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
ClientCapabilities & | R | ||
) |
Definition at line 246 of file Protocol.cpp.
References clang::clangd::ClientCapabilities::textDocument, and clang::clangd::ClientCapabilities::workspace.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
InitializeParams & | R | ||
) |
Definition at line 255 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 json::Value & | Params, |
DidOpenTextDocumentParams & | R | ||
) |
Definition at line 270 of file Protocol.cpp.
References clang::clangd::DidOpenTextDocumentParams::metadata, and clang::clangd::DidOpenTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DidCloseTextDocumentParams & | R | ||
) |
Definition at line 276 of file Protocol.cpp.
References clang::clangd::DidCloseTextDocumentParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
SymbolKind & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DidChangeTextDocumentParams & | R | ||
) |
Definition at line 281 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 & | , |
std::vector< SymbolKind > & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | E, |
FileChangeType & | Out | ||
) |
Definition at line 288 of file Protocol.cpp.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
SymbolKindCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
WorkspaceSymbolCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
FileEvent & | R | ||
) |
Definition at line 299 of file Protocol.cpp.
References clang::clangd::FileEvent::type, and clang::clangd::FileEvent::uri.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DidChangeWatchedFilesParams & | R | ||
) |
Definition at line 304 of file Protocol.cpp.
References clang::clangd::DidChangeWatchedFilesParams::changes.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
WorkspaceClientCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextDocumentContentChangeEvent & | R | ||
) |
Definition at line 309 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 & | , |
TextDocumentClientCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
FormattingOptions & | R | ||
) |
Definition at line 315 of file Protocol.cpp.
References clang::clangd::FormattingOptions::insertSpaces, and clang::clangd::FormattingOptions::tabSize.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
ClientCapabilities & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DocumentRangeFormattingParams & | R | ||
) |
Definition at line 328 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 & | , |
ClangdConfigurationParamsChange & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DocumentOnTypeFormattingParams & | R | ||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DocumentFormattingParams & | R | ||
) |
Definition at line 341 of file Protocol.cpp.
References clang::clangd::DocumentFormattingParams::options, and clang::clangd::DocumentFormattingParams::textDocument.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DocumentSymbolParams & | R | ||
) |
Definition at line 347 of file Protocol.cpp.
References clang::clangd::DocumentSymbolParams::textDocument.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
Diagnostic & | R | ||
) |
Definition at line 352 of file Protocol.cpp.
References clang::clangd::Diagnostic::message, clang::clangd::Diagnostic::range, and clang::clangd::Diagnostic::severity.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
CodeActionContext & | R | ||
) |
Definition at line 360 of file Protocol.cpp.
References clang::clangd::CodeActionContext::diagnostics.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
InitializeParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DidOpenTextDocumentParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DidCloseTextDocumentParams & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
CodeActionParams & | R | ||
) |
Definition at line 387 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 & | , |
TextDocumentContentChangeEvent & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
WorkspaceEdit & | R | ||
) |
Definition at line 393 of file Protocol.cpp.
References clang::clangd::WorkspaceEdit::changes, and clang::clangd::ExecuteCommandParams::CLANGD_APPLY_FIX_COMMAND.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
ExecuteCommandParams & | R | ||
) |
Definition at line 400 of file Protocol.cpp.
References clang::clangd::ExecuteCommandParams::command.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DidChangeTextDocumentParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | E, |
FileChangeType & | Out | ||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
FileEvent & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
WorkspaceSymbolParams & | R | ||
) |
Definition at line 428 of file Protocol.cpp.
References clang::clangd::WorkspaceSymbolParams::query.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DidChangeWatchedFilesParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DidChangeConfigurationParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
FormattingOptions & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
TextDocumentPositionParams & | R | ||
) |
Definition at line 453 of file Protocol.cpp.
References clang::clangd::TextDocumentPositionParams::position, and clang::clangd::TextDocumentPositionParams::textDocument.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DocumentRangeFormattingParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DocumentOnTypeFormattingParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DocumentFormattingParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
DocumentSymbolParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
Diagnostic & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
CodeActionContext & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
CodeActionParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
WorkspaceEdit & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
RenameParams & | R | ||
) |
Definition at line 566 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 & | , |
ExecuteCommandParams & | |||
) |
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
DidChangeConfigurationParams & | CCP | ||
) |
Definition at line 589 of file Protocol.cpp.
References clang::clangd::DidChangeConfigurationParams::settings.
bool clang::clangd::fromJSON | ( | const json::Value & | Params, |
ClangdConfigurationParamsChange & | CCPC | ||
) |
Definition at line 594 of file Protocol.cpp.
References clang::clangd::ClangdConfigurationParamsChange::compilationDatabasePath.
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
WorkspaceSymbolParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
TextDocumentPositionParams & | |||
) |
bool clang::clangd::fromJSON | ( | const llvm::json::Value & | , |
RenameParams & | |||
) |
llvm::Optional< std::string > clang::clangd::getAbsoluteFilePath | ( | const FileEntry * | F, |
const SourceManager & | SourceMgr | ||
) |
Get the absolute file path of a given file entry.
Definition at line 189 of file SourceCode.cpp.
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 375 of file ClangdUnit.cpp.
References AST, and clang::clangd::ParsedAST::getASTContext().
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 603 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 46 of file CodeCompletionStrings.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
llvm::Expected< std::vector< SymbolInformation > > 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 265 of file FindSymbols.cpp.
References clang::clangd::ParsedAST::getASTContext(), and clang::clangd::ParsedAST::getLocalTopLevelDecls().
Referenced by clang::clangd::ClangdServer::documentSymbols().
Get the hover information when hovering at Pos
.
Definition at line 652 of file XRefs.cpp.
Referenced by clang::clangd::ClangdServer::findHover().
|
static |
Generate a Hover
object given the declaration D
.
Definition at line 474 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 518 of file XRefs.cpp.
References clang::clangd::Hover::contents, and clang::clangd::MarkupContent::value.
std::string clang::clangd::getParameterDocComment | ( | const ASTContext & | Ctx, |
const CodeCompleteConsumer::OverloadCandidate & | Result, | ||
unsigned | ArgIndex, | ||
bool | CommentsFromHeaders | ||
) |
Gets a minimally formatted documentation for parameter of Result
, corresponding to argument number ArgIndex
.
This currently looks for comments attached to the parameter itself, and doesn't extract them from function documentation. 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 76 of file CodeCompletionStrings.cpp.
std::string clang::clangd::getReturnType | ( | const CodeCompletionString & | CCS | ) |
Gets detail to be used as the detail field in an LSP completion item.
This is usually the return type of a function.
Definition at line 196 of file CodeCompletionStrings.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
|
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 458 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 249 of file Diagnostics.cpp.
Referenced by toLSPDiags().
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 94 of file CodeCompletionStrings.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
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.
llvm::Expected<std::vector<SymbolInformation> > clang::clangd::getWorkspaceSymbols | ( | StringRef | Query, |
int | Limit, | ||
const SymbolIndex *const | Index, | ||
StringRef | HintPath | ||
) |
Definition at line 102 of file FindSymbols.cpp.
Referenced by clang::clangd::ClangdServer::workspaceSymbols().
Range clang::clangd::halfOpenToRange | ( | const SourceManager & | SM, |
CharSourceRange | R | ||
) |
Definition at line 147 of file SourceCode.cpp.
|
static |
Definition at line 36 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
Definition at line 46 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
SymbolSlab clang::clangd::indexAST | ( | ASTContext & | AST, |
std::shared_ptr< Preprocessor > | PP, | ||
llvm::ArrayRef< std::string > | URISchemes = {} |
||
) |
Retrieves namespace and class level symbols in AST
.
Exposed to assist in unit tests. If URISchemes is empty, the default schemes in SymbolCollector will be used.
Definition at line 18 of file FileIndex.cpp.
|
static |
Definition at line 75 of file FuzzyMatch.cpp.
Referenced by clang::clangd::FuzzyMatcher::dumpLast(), and clang::clangd::FuzzyMatcher::match().
bool clang::clangd::isIndexedForCodeCompletion | ( | const NamedDecl & | ND, |
ASTContext & | ASTCtx | ||
) |
Definition at line 1252 of file CodeComplete.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
|
static |
Definition at line 148 of file Quality.cpp.
Referenced by clang::clangd::SymbolRelevanceSignals::merge().
|
static |
Definition at line 158 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 64 of file Headers.cpp.
Referenced by clang::clangd::HeaderFile::valid().
|
static |
Definition at line 30 of file Quality.cpp.
Referenced by clang::clangd::SymbolQualitySignals::merge().
|
static |
Definition at line 30 of file SourceCode.cpp.
Referenced by measureUTF16(), and utf16Len().
void clang::clangd::log | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 62 of file Logger.h.
References clang::clangd::Logger::Info, and clang::clangd::detail::log().
Referenced by clang::clangd::ParsedAST::build(), buildCompilerInvocation(), clang::clangd::URIDistance::distance(), fromJSON(), clang::clangd::DirectoryBasedGlobalCompilationDatabase::getCompileCommand(), and clang::clangd::StoreDiags::HandleDiagnostic().
|
static |
Definition at line 70 of file FuzzyMatch.cpp.
Referenced by calculateRoles(), clang::clangd::FuzzyMatcher::FuzzyMatcher(), and clang::tidy::bugprone::isLikelyTypo().
|
static |
Definition at line 57 of file SourceCode.cpp.
References iterateCodepoints().
Referenced by positionToOffset().
std::unique_ptr< SymbolIndex > clang::clangd::mergeIndex | ( | const SymbolIndex * | Dynamic, |
const SymbolIndex * | Static | ||
) |
Symbol clang::clangd::mergeSymbol | ( | const Symbol & | L, |
const Symbol & | R, | ||
Symbol::Details * | Scratch | ||
) |
Definition at line 83 of file Merge.cpp.
References clang::clangd::Symbol::CanonicalDeclaration, clang::clangd::Symbol::CompletionSnippetSuffix, clang::clangd::Symbol::Definition, clang::clangd::Symbol::Detail, clang::clangd::Symbol::Details::Documentation, clang::clangd::Symbol::ID, clang::clangd::Symbol::Details::IncludeHeader, Merge, clang::clangd::Symbol::Origin, clang::clangd::Symbol::References, clang::clangd::Symbol::Details::ReturnType, and clang::clangd::Symbol::Signature.
|
static |
Return a string representation (e.g.
"namespace ns1::ns2") of the named declaration ND
.
Definition at line 442 of file XRefs.cpp.
References Name, and printingPolicyForDecls().
Referenced by getScopeName().
std::pair<size_t, size_t> clang::clangd::offsetToClangLineColumn | ( | llvm::StringRef | Code, |
size_t | Offset | ||
) |
std::pair<size_t, size_t> clang::clangd::offsetToClangLineColumn | ( | StringRef | Code, |
size_t | Offset | ||
) |
Definition at line 155 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()].
Position clang::clangd::offsetToPosition | ( | StringRef | Code, |
size_t | Offset | ||
) |
Definition at line 118 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, Lines, Pos, and utf16Len().
Referenced by replacementToEdit().
|
inline |
Definition at line 145 of file Index.h.
References operator<<().
bool clang::clangd::operator< | ( | const CompletionItem & | L, |
const CompletionItem & | R | ||
) |
Definition at line 517 of file Protocol.cpp.
References clang::clangd::CompletionItem::label, and clang::clangd::CompletionItem::sortText.
Referenced by clang::tidy::ClangTidyDiagnosticConsumer::HandleDiagnostic().
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | OS, |
const SymbolLocation & | L | ||
) |
Definition at line 19 of file Index.cpp.
References clang::clangd::SymbolLocation::Position::Column, clang::clangd::SymbolLocation::End, clang::clangd::SymbolLocation::FileURI, clang::clangd::SymbolLocation::Position::Line, clang::clangd::SymbolLocation::Start, and clang::clangd::SymbolID::SymbolID().
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | OS, |
const SymbolID & | ID | ||
) |
raw_ostream & clang::clangd::operator<< | ( | raw_ostream & | OS, |
SymbolOrigin | O | ||
) |
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | , |
const SymbolLocation & | |||
) |
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | OS, |
const Symbol & | S | ||
) |
Definition at line 57 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 58 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | , |
const SymbolQualitySignals & | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Position & | P | ||
) |
Definition at line 83 of file Protocol.cpp.
References clang::clangd::Position::character, and clang::clangd::Position::line.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const SymbolID & | ID | ||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Range & | R | ||
) |
Definition at line 99 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 110 of file Protocol.cpp.
References clang::clangd::Location::range, and clang::clangd::Location::uri.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | , |
const SymbolRelevanceSignals & | |||
) |
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const TextEdit & | TE | ||
) |
Definition at line 140 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 DiagBase & | D | ||
) |
Definition at line 186 of file Diagnostics.cpp.
References clang::clangd::DiagBase::File, clang::clangd::DiagBase::InsideMainFile, and clang::clangd::DiagBase::Message.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Fix & | F | ||
) |
Definition at line 192 of file Diagnostics.cpp.
References clang::clangd::Fix::Message.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diag & | D | ||
) |
Definition at line 202 of file Diagnostics.cpp.
References clang::clangd::Diag::Notes.
llvm::raw_ostream& clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Symbol & | S | ||
) |
raw_ostream& clang::clangd::operator<< | ( | raw_ostream & | OS, |
const SymbolQualitySignals & | S | ||
) |
Definition at line 234 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 & | OS, |
const SymbolRelevanceSignals & | S | ||
) |
Definition at line 349 of file Quality.cpp.
References clang::clangd::SymbolRelevanceSignals::Context, clang::clangd::SymbolRelevanceSignals::evaluate(), clang::clangd::SymbolRelevanceSignals::FileProximityMatch, clang::clangd::SymbolRelevanceSignals::Forbidden, clang::clangd::SymbolRelevanceSignals::IsInstanceMember, clang::clangd::SymbolRelevanceSignals::NameMatch, proximityScore(), clang::clangd::SymbolRelevanceSignals::Query, clang::clangd::SymbolRelevanceSignals::Scope, clang::clangd::SymbolRelevanceSignals::SemaProximityScore, and clang::clangd::SymbolRelevanceSignals::SymbolURI.
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | OS, |
const Diagnostic & | D | ||
) |
Definition at line 365 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 & | O, |
const SymbolInformation & | SI | ||
) |
Definition at line 422 of file Protocol.cpp.
References clang::clangd::SymbolInformation::containerName, clang::clangd::SymbolInformation::name, and toJSON().
llvm::raw_ostream & clang::clangd::operator<< | ( | llvm::raw_ostream & | O, |
const CompletionItem & | I | ||
) |
Definition at line 512 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 548 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 579 of file Protocol.cpp.
References clang::clangd::DocumentHighlight::kind, clang::clangd::DocumentHighlight::range, Read, and Write.
raw_ostream & clang::clangd::operator<< | ( | raw_ostream & | OS, |
const CodeCompletion & | C | ||
) |
Definition at line 1288 of file CodeComplete.cpp.
References clang::clangd::CodeCompletion::render().
Referenced by clang::clangd::Range::contains(), operator &(), clang::clangd::LSPDiagnosticCompare::operator()(), and clang::clangd::SymbolLocation::operator==().
raw_ostream & clang::clangd::operator<< | ( | raw_ostream & | OS, |
const CodeCompleteResult & | R | ||
) |
Definition at line 1293 of file CodeComplete.cpp.
References clang::clangd::CodeCompleteResult::Completions, clang::clangd::CodeCompleteResult::Context, and clang::clangd::CodeCompleteResult::HasMore.
void clang::clangd::operator>> | ( | StringRef | Str, |
SymbolID & | ID | ||
) |
void clang::clangd::operator>> | ( | llvm::StringRef | HexStr, |
SymbolID & | ID | ||
) |
|
inline |
|
inline |
|
static |
|
static |
Definition at line 153 of file FuzzyMatch.cpp.
llvm::Expected<size_t> clang::clangd::positionToOffset | ( | llvm::StringRef | Code, |
Position | P, | ||
bool | AllowColumnsBeyondLineLength = true |
||
) |
Turn a [line, column] pair into an offset in Code.
If P.character exceeds the line length, returns the offset at end-of-line. (If !AllowColumnsBeyondLineLength, then returns an error instead). If the line number is out of range, returns an error.
The returned value is in the range [0, Code.size()].
llvm::Expected<size_t> clang::clangd::positionToOffset | ( | StringRef | Code, |
Position | P, | ||
bool | AllowColumnsBeyondLineLength | ||
) |
Definition at line 83 of file SourceCode.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and measureUTF16().
Referenced by clang::clangd::ClangdServer::formatOnType(), and clang::clangd::ClangdServer::formatRange().
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< vfs::FileSystem > | , | ||
DiagnosticConsumer & | |||
) |
Creates a compiler instance, configured so that:
MainFile
.MainFile
. Definition at line 43 of file Compiler.cpp.
Referenced by clang::clangd::ParsedAST::build().
|
static |
Definition at line 413 of file XRefs.cpp.
Referenced by getHoverContents(), namedDeclQualifiedName(), and typeDeclToString().
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 41 of file AST.cpp.
Referenced by clang::clangd::SymbolCollector::finish().
|
static |
Definition at line 297 of file Quality.cpp.
References clang::clangd::URIDistance::distance(), and clang::tidy::bugprone::f().
Referenced by clang::clangd::SymbolRelevanceSignals::evaluate(), and operator<<().
double clang::clangd::quality | ( | const Symbol & | S | ) |
Definition at line 61 of file Index.cpp.
References clang::clangd::detail::log(), and clang::clangd::Symbol::References.
Referenced by clang::clangd::MemIndex::fuzzyFind().
void clang::clangd::registerCallbackHandlers | ( | JSONRPCDispatcher & | Dispatcher, |
ProtocolCallbacks & | Callbacks | ||
) |
Definition at line 47 of file ProtocolHandlers.cpp.
References clang::clangd::ProtocolCallbacks::onChangeConfiguration(), clang::clangd::ProtocolCallbacks::onCodeAction(), clang::clangd::ProtocolCallbacks::onCommand(), clang::clangd::ProtocolCallbacks::onCompletion(), clang::clangd::ProtocolCallbacks::onDocumentDidChange(), clang::clangd::ProtocolCallbacks::onDocumentDidClose(), clang::clangd::ProtocolCallbacks::onDocumentDidOpen(), clang::clangd::ProtocolCallbacks::onDocumentFormatting(), clang::clangd::ProtocolCallbacks::onDocumentHighlight(), clang::clangd::ProtocolCallbacks::onDocumentOnTypeFormatting(), clang::clangd::ProtocolCallbacks::onDocumentRangeFormatting(), clang::clangd::ProtocolCallbacks::onDocumentSymbol(), clang::clangd::ProtocolCallbacks::onExit(), clang::clangd::ProtocolCallbacks::onFileEvent(), clang::clangd::ProtocolCallbacks::onGoToDefinition(), clang::clangd::ProtocolCallbacks::onHover(), clang::clangd::ProtocolCallbacks::onInitialize(), clang::clangd::ProtocolCallbacks::onRename(), clang::clangd::ProtocolCallbacks::onShutdown(), clang::clangd::ProtocolCallbacks::onSignatureHelp(), clang::clangd::ProtocolCallbacks::onSwitchSourceHeader(), and clang::clangd::ProtocolCallbacks::onWorkspaceSymbol().
Referenced by clang::clangd::ClangdLSPServer::run().
std::vector< TextEdit > clang::clangd::replacementsToEdits | ( | StringRef | Code, |
const tooling::Replacements & | Repls | ||
) |
Definition at line 180 of file SourceCode.cpp.
TextEdit clang::clangd::replacementToEdit | ( | StringRef | Code, |
const tooling::Replacement & | R | ||
) |
Definition at line 173 of file SourceCode.cpp.
References offsetToPosition().
Referenced by clang::clangd::IncludeInserter::insert().
void clang::clangd::reply | ( | llvm::json::Value && | Result | ) |
Sends a successful reply.
Current context must derive from JSONRPCDispatcher::Handler.
Referenced by clang::clangd::JSONOutput::mirrorInput().
void clang::clangd::replyError | ( | ErrorCode | Code, |
const llvm::StringRef & | Message | ||
) |
Sends an error response to the client, and logs it.
Current context must derive from JSONRPCDispatcher::Handler.
Definition at line 112 of file JSONRPCDispatcher.cpp.
References call(), elog(), clang::clangd::detail::log(), and Method.
Referenced by clang::clangd::ClangdLSPServer::run().
void clang::clangd::runLanguageServerLoop | ( | std::FILE * | In, |
JSONOutput & | Out, | ||
JSONStreamStyle | InputStyle, | ||
JSONRPCDispatcher & | Dispatcher, | ||
bool & | IsDone | ||
) |
Parses input queries from LSP client (coming from In
) and runs call method of Dispatcher
for each query.
After handling each query checks if IsDone
is set true and exits the loop if it is. Input stream(In
) must be opened in binary mode to avoid preliminary replacements of
with
. We use C-style FILE* for reading as std::istream has unclear interaction with signals, which are sent by debuggers on some OSs.
Definition at line 343 of file JSONRPCDispatcher.cpp.
Referenced by clang::clangd::ClangdLSPServer::run().
SignatureHelp clang::clangd::signatureHelp | ( | PathRef | FileName, |
const tooling::CompileCommand & | Command, | ||
PrecompiledPreamble const * | Preamble, | ||
StringRef | Contents, | ||
Position | Pos, | ||
IntrusiveRefCntPtr< vfs::FileSystem > | VFS, | ||
std::shared_ptr< PCHContainerOperations > | PCHs | ||
) |
Get signature help at a specified Pos
in FileName
.
Definition at line 1232 of file CodeComplete.cpp.
References Command, Contents, FileName, Pos, and Preamble.
Referenced by clang::clangd::ClangdServer::signatureHelp().
std::string clang::clangd::sortText | ( | float | Score, |
llvm::StringRef | Tiebreak = "" |
||
) |
Returns a string that sorts in the same order as (-Score, Tiebreak), for LSP.
(The highest score compares smallest so it sorts at the top).
Definition at line 385 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 130 of file SourceCode.cpp.
std::pair< llvm::StringRef, llvm::StringRef > clang::clangd::splitQualifiedName | ( | llvm::StringRef | QName | ) |
From "a::b::c", return {"a::b::", "c"}.
Scope is empty if there's no qualifier.
Definition at line 166 of file SourceCode.cpp.
References Pos.
Referenced by clang::clangd::SymbolCollector::finish().
Symbol clang::clangd::SymbolFromYAML | ( | llvm::yaml::Input & | Input, |
llvm::BumpPtrAllocator & | Arena | ||
) |
Definition at line 184 of file SymbolYAML.cpp.
SymbolSlab clang::clangd::symbolsFromYAML | ( | llvm::StringRef | YAMLContent | ) |
Definition at line 171 of file SymbolYAML.cpp.
References clang::clangd::SymbolSlab::Builder::insert().
void clang::clangd::SymbolsToYAML | ( | const SymbolSlab & | Symbols, |
llvm::raw_ostream & | OS | ||
) |
Definition at line 192 of file SymbolYAML.cpp.
Referenced by main().
std::string clang::clangd::SymbolToYAML | ( | Symbol | Sym | ) |
Definition at line 198 of file SymbolYAML.cpp.
Deadline clang::clangd::timeoutSeconds | ( | llvm::Optional< double > | Seconds | ) |
Makes a deadline from a timeout in seconds. None means wait forever.
Definition at line 82 of file Threading.cpp.
References clang::clangd::Deadline::infinity().
Referenced by clang::clangd::ClangdServer::blockUntilIdleForTest(), and clang::clangd::Deadline::operator==().
llvm::json::Value clang::clangd::toJSON | ( | const URIForFile & | U | ) |
Serialize/deserialize URIForFile
to/from a string URI.
Definition at line 56 of file Protocol.cpp.
References clang::clangd::URIForFile::uri().
Referenced by clang::clangd::Range::contains(), operator<<(), and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const TextDocumentIdentifier & | R | ) |
Definition at line 62 of file Protocol.cpp.
References Object, and clang::clangd::TextDocumentIdentifier::uri.
llvm::json::Value clang::clangd::toJSON | ( | const Position & | P | ) |
Definition at line 76 of file Protocol.cpp.
References clang::clangd::Position::character, clang::clangd::Position::line, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const Range & | P | ) |
Definition at line 92 of file Protocol.cpp.
References clang::clangd::Range::end, Object, and clang::clangd::Range::start.
llvm::json::Value clang::clangd::toJSON | ( | const Location & | P | ) |
Definition at line 103 of file Protocol.cpp.
References Object, clang::clangd::Location::range, and clang::clangd::Location::uri.
llvm::json::Value clang::clangd::toJSON | ( | const TextEdit & | P | ) |
Definition at line 133 of file Protocol.cpp.
References clang::clangd::TextEdit::newText, Object, and clang::clangd::TextEdit::range.
llvm::json::Value clang::clangd::toJSON | ( | const FormattingOptions & | P | ) |
Definition at line 321 of file Protocol.cpp.
References clang::clangd::FormattingOptions::insertSpaces, Object, and clang::clangd::FormattingOptions::tabSize.
llvm::json::Value clang::clangd::toJSON | ( | const SymbolInformation & | P | ) |
Definition at line 413 of file Protocol.cpp.
References clang::clangd::SymbolInformation::containerName, clang::clangd::SymbolInformation::kind, clang::clangd::SymbolInformation::location, clang::clangd::SymbolInformation::name, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const Command & | C | ) |
Definition at line 433 of file Protocol.cpp.
References clang::clangd::ExecuteCommandParams::command, Object, clang::clangd::Command::title, and clang::clangd::ExecuteCommandParams::workspaceEdit.
llvm::json::Value clang::clangd::toJSON | ( | const WorkspaceEdit & | WE | ) |
Definition at line 440 of file Protocol.cpp.
References Array, clang::clangd::WorkspaceEdit::changes, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const ApplyWorkspaceEditParams & | Params | ) |
Definition at line 449 of file Protocol.cpp.
References clang::clangd::ApplyWorkspaceEditParams::edit, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const MarkupContent & | MC | ) |
Definition at line 469 of file Protocol.cpp.
References clang::clangd::MarkupContent::kind, Object, toTextKind(), and clang::clangd::MarkupContent::value.
llvm::json::Value clang::clangd::toJSON | ( | const Hover & | H | ) |
Definition at line 479 of file Protocol.cpp.
References clang::clangd::Hover::contents, Object, clang::clangd::Hover::range, and toJSON().
llvm::json::Value clang::clangd::toJSON | ( | const CompletionItem & | CI | ) |
Definition at line 488 of file Protocol.cpp.
References clang::clangd::CompletionItem::additionalTextEdits, Array, 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, Object, clang::clangd::CompletionItem::sortText, and clang::clangd::CompletionItem::textEdit.
llvm::json::Value clang::clangd::toJSON | ( | const CompletionList & | L | ) |
Definition at line 522 of file Protocol.cpp.
References Array, clang::clangd::CompletionList::isIncomplete, clang::clangd::CompletionList::items, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const ParameterInformation & | PI | ) |
Definition at line 529 of file Protocol.cpp.
References clang::clangd::ParameterInformation::documentation, clang::clangd::ParameterInformation::label, and Object.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureInformation & | SI | ) |
Definition at line 537 of file Protocol.cpp.
References Array, clang::clangd::SignatureInformation::documentation, clang::clangd::SignatureInformation::label, Object, and clang::clangd::SignatureInformation::parameters.
llvm::json::Value clang::clangd::toJSON | ( | const SignatureHelp & | SH | ) |
Definition at line 554 of file Protocol.cpp.
References clang::clangd::SignatureHelp::activeParameter, clang::clangd::SignatureHelp::activeSignature, Array, Object, and clang::clangd::SignatureHelp::signatures.
llvm::json::Value clang::clangd::toJSON | ( | const DocumentHighlight & | DH | ) |
Definition at line 572 of file Protocol.cpp.
References clang::clangd::DocumentHighlight::kind, Object, clang::clangd::DocumentHighlight::range, and toJSON().
void clang::clangd::toLSPDiags | ( | const Diag & | D, |
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 224 of file Diagnostics.cpp.
References clang::clangd::Diag::Fixes, getSeverity(), clang::clangd::DiagBase::InsideMainFile, clang::clangd::Diagnostic::message, clang::clangd::Diag::Notes, clang::clangd::DiagBase::Range, clang::clangd::Diagnostic::range, clang::clangd::DiagBase::Severity, and clang::clangd::Diagnostic::severity.
Referenced by clang::clangd::ClangdLSPServer::run().
|
static |
Definition at line 459 of file Protocol.cpp.
References Markdown, and PlainText.
Referenced by toJSON().
|
static |
Return a string representation (e.g.
"class MyNamespace::MyClass") of the type declaration TD
.
Definition at line 427 of file XRefs.cpp.
References Name, and printingPolicyForDecls().
Referenced by getScopeName().
|
static |
Definition at line 72 of file SourceCode.cpp.
References iterateCodepoints().
Referenced by offsetToPosition().
void clang::clangd::vlog | ( | const char * | Fmt, |
Ts &&... | Vals | ||
) |
Definition at line 67 of file Logger.h.
References clang::clangd::detail::log(), and clang::clangd::Logger::Verbose.
Referenced by clang::clangd::JSONOutput::writeMessage().
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 90 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 90 of file Threading.cpp.
References clang::clangd::Deadline::infinity(), clang::clangd::Deadline::time(), and clang::clangd::Deadline::zero().
Referenced by clang::clangd::AsyncTaskRunner::wait(), and clang::clangd::AsyncTaskRunner::~AsyncTaskRunner().
|
static |
Definition at line 74 of file FuzzyMatch.cpp.
Referenced by calculateRoles(), and clang::clangd::FuzzyMatcher::FuzzyMatcher().
|
static |
Definition at line 143 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
|
static |
Definition at line 116 of file FuzzyMatch.cpp.
Referenced by calculateRoles().
|
static |
Definition at line 76 of file FuzzyMatch.cpp.
constexpr auto clang::clangd::SymbolKindMax = static_cast<size_t>(SymbolKind::TypeParameter) |
Definition at line 277 of file Protocol.h.
constexpr auto clang::clangd::SymbolKindMin = static_cast<size_t>(SymbolKind::File) |
Definition at line 276 of file Protocol.h.
Referenced by adjustKindToCapability().