15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H 16 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H 25 #include "clang/Sema/CodeCompleteConsumer.h" 26 #include "clang/Sema/CodeCompleteOptions.h" 27 #include "clang/Tooling/CompilationDatabase.h" 28 #include "llvm/ADT/Optional.h" 29 #include "llvm/ADT/SmallVector.h" 30 #include "llvm/ADT/StringRef.h" 31 #include "llvm/Support/Error.h" 161 unsigned BundleSize = 1;
194 float ExcludingName = 0.f;
204 float Relevance = 0.f;
209 bool Deprecated =
false;
217 bool HasMore =
false;
221 bool RanParser =
true;
251 const tooling::CompileCommand &
Command,
254 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
VFS,
260 const tooling::CompileCommand &
Command,
263 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
VFS,
297 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H std::future< SymbolSlab > Result
The result is consumed by codeComplete() if speculation succeeded.
bool ShowOrigins
Expose origins of completion items in the label (for debugging).
const tooling::CompileCommand & Command
size_t Limit
Limit the number of results returned (0 means no limit).
SignatureQualitySignals Quality
Always use text-based completion.
llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS
bool EnableSnippets
When true, completion items will contain expandable code snippets in completion (e.g.
std::vector< CodeCompletion > Completions
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
Run the parser if inputs (preamble) are ready.
llvm::StringRef PathRef
A typedef to represent a ref to file path.
std::string SnippetSuffix
CodeCompletionParse
Whether to use the clang parser, or fallback to text-based completion (using identifiers in the curre...
llvm::Optional< TextEdit > Insertion
CompletionItemKind
The kind of a completion entry.
SignatureHelp signatureHelp(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const SymbolIndex *Index)
llvm::Optional< FuzzyFindRequest > CachedReq
A cached request from past code completions.
std::string Documentation
bool IncludeFixIts
Include completions that require small corrections, e.g.
bool IncludeComments
Add comments to code completion results, if available.
bool IncludeCodePatterns
Add code patterns to completion results.
bool isIndexedForCodeCompletion(const NamedDecl &ND, ASTContext &ASTCtx)
bool SpeculativeIndexRequest
If set to true, this will send an asynchronous speculative index request, based on the index request ...
A speculative and asynchronous fuzzy find index request (based on cached request) that can be sent be...
A visual indicator to prepend to the completion label to indicate whether completion result would tri...
llvm::SmallVector< IncludeCandidate, 1 > Includes
bool IncludeIneligibleResults
Include results that are not legal completions in the current context.
enum clang::clangd::CodeCompleteOptions::CodeCompletionParse RunParser
llvm::Optional< bool > BundleOverloads
Combine overloads into a single completion item where possible.
llvm::Optional< FuzzyFindRequest > NewReq
The actual request used by codeComplete().
A context is an immutable container for per-request data that must be propagated through layers that ...
clang::CodeCompleteOptions getClangCompleteOpts() const
Returns options that can be passed to clang's completion engine.
llvm::StringRef Qualifier
CodeCompleteResult codeComplete(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind)
const SymbolIndex * Index
If Index is set, it is used to augment the code completion results.
Represents the signature of a callable.
Block until we can run the parser (e.g.
const PreambleData * Preamble
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
struct clang::clangd::CodeCompleteOptions::IncludeInsertionIndicator IncludeIndicator
bool IncludeMacros
Add macros to code completion results.
bool EnableFunctionArgSnippets
Whether to generate snippets for function arguments on code-completion.
std::string RequiredQualifier
bool AllScopes
Whether to include index symbols that are not defined in the scopes visible from the code completion ...
CompletionPrefix guessCompletionPrefix(llvm::StringRef Content, unsigned Offset)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
The parsed preamble and associated data.
enum clang::clangd::CodeCompleteOptions::IncludeInsertion InsertIncludes
Range CompletionTokenRange
Holds the range of the token we are going to replace with this completion.
std::vector< TextEdit > FixIts
Holds information about small corrections that needs to be done.