16 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H 17 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H 25 #include "clang/Frontend/PrecompiledPreamble.h" 26 #include "clang/Sema/CodeCompleteConsumer.h" 27 #include "clang/Sema/CodeCompleteOptions.h" 28 #include "clang/Tooling/CompilationDatabase.h" 29 #include "llvm/ADT/Optional.h" 30 #include "llvm/ADT/SmallVector.h" 31 #include "llvm/ADT/StringRef.h" 32 #include "llvm/Support/Error.h" 37 class PCHContainerOperations;
141 unsigned BundleSize = 1;
174 float ExcludingName = 0.f;
184 float Relevance = 0.f;
189 bool Deprecated =
false;
197 bool HasMore =
false;
224 const tooling::CompileCommand &
Command,
227 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
VFS,
228 std::shared_ptr<PCHContainerOperations>
PCHs,
234 const tooling::CompileCommand &
Command,
237 IntrusiveRefCntPtr<llvm::vfs::FileSystem>
VFS,
238 std::shared_ptr<PCHContainerOperations>
PCHs,
255 llvm::Expected<llvm::StringRef>
261 #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).
SignatureHelp signatureHelp(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, const SymbolIndex *Index)
const tooling::CompileCommand & Command
bool BundleOverloads
Combine overloads into a single completion item where possible.
size_t Limit
Limit the number of results returned (0 means no limit).
CodeCompleteResult codeComplete(PathRef FileName, const tooling::CompileCommand &Command, const PreambleData *Preamble, llvm::StringRef Contents, Position Pos, llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, std::shared_ptr< PCHContainerOperations > PCHs, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind)
SignatureQualitySignals Quality
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...
llvm::StringRef PathRef
A typedef to represent a ref to file path.
std::string SnippetSuffix
llvm::Expected< llvm::StringRef > speculateCompletionFilter(llvm::StringRef Content, Position Pos)
Retrives a speculative code completion filter text before the cursor.
llvm::Optional< TextEdit > Insertion
CompletionItemKind
The kind of a completion entry.
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.
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.
const SymbolIndex * Index
If Index is set, it is used to augment the code completion results.
Represents the signature of a callable.
const PreambleData * Preamble
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::shared_ptr< PCHContainerOperations > PCHs
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 ...
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
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.