Go to the documentation of this file.
15 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
16 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
27 #include "clang/Sema/CodeCompleteConsumer.h"
28 #include "clang/Sema/CodeCompleteOptions.h"
29 #include "llvm/ADT/Optional.h"
30 #include "llvm/ADT/SmallVector.h"
31 #include "llvm/ADT/StringRef.h"
39 struct CodeCompletion;
325 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
enum clang::clangd::CodeCompleteOptions::CodeCompletionParse RunParser
std::unique_ptr< GlobalCompilationDatabase > Base
llvm::Optional< FuzzyFindRequest > NewReq
The actual request used by codeComplete().
std::vector< CodeCompletion > Completions
llvm::Optional< Range > CompletionRange
float DecisionForestBase
Weight for combining NameMatch and Prediction of DecisionForest.
bool ShowOrigins
Expose origins of completion items in the label (for debugging).
llvm::SmallVector< IncludeCandidate, 1 > Includes
CodeCompletionParse
Whether to use the clang parser, or fallback to text-based completion (using identifiers in the curre...
enum clang::clangd::CodeCompleteOptions::IncludeInsertion InsertIncludes
const ParseInputs & ParseInput
Same semantics as CodeComplete::Score.
@ ParseIfReady
Run the parser if inputs (preamble) are ready.
const SymbolIndex * Index
If Index is set, it is used to augment the code completion results.
A speculative and asynchronous fuzzy find index request (based on cached request) that can be sent be...
std::string RequiredQualifier
bool EnableFunctionArgSnippets
Whether to generate snippets for function arguments on code-completion.
CompletionItem render(const CodeCompleteOptions &) const
Attributes of a symbol that affect how much we like it.
bool Deprecated
Indicates if this item is deprecated.
bool AllScopes
Whether to include index symbols that are not defined in the scopes visible from the code completion ...
CodeCompletionRankingModel
Model to use for ranking code completion candidates.
struct clang::clangd::CodeCompleteOptions::IncludeInsertionIndicator IncludeIndicator
Range CompletionTokenRange
Holds the range of the token we are going to replace with this completion.
The parsed preamble and associated data.
std::vector< TextEdit > FixIts
Holds information about small corrections that needs to be done.
bool IncludeIneligibleResults
Include results that are not legal completions in the current context.
CodeCompleteResult codeComplete(PathRef FileName, Position Pos, const PreambleData *Preamble, const ParseInputs &ParseInput, CodeCompleteOptions Opts, SpeculativeFuzzyFind *SpecFuzzyFind)
Gets code completions at a specified Pos in FileName.
const ASTSignals * MainFileSignals
DecisionForestScores evaluateDecisionForest(const SymbolQualitySignals &Quality, const SymbolRelevanceSignals &Relevance, float Base)
bool IncludeFixIts
Include completions that require small corrections, e.g.
@ NeverParse
Always use text-based completion.
llvm::Optional< bool > BundleOverloads
Combine overloads into a single completion item where possible.
std::future< SymbolSlab > Result
The result is consumed by codeComplete() if speculation succeeded.
bool isIndexedForCodeCompletion(const NamedDecl &ND, ASTContext &ASTCtx)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
CompletionItemKind
The kind of a completion entry.
SignatureHelp signatureHelp(PathRef FileName, Position Pos, const PreambleData &Preamble, const ParseInputs &ParseInput, MarkupKind DocumentationFormat)
Get signature help at a specified Pos in FileName.
std::function< void(const CodeCompletion &, const SymbolQualitySignals &, const SymbolRelevanceSignals &, float Score)> RecordCCResult
Callback invoked on all CompletionCandidate after they are scored and before they are ranked (by -Sco...
bool allowImplicitCompletion(llvm::StringRef Content, unsigned Offset)
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
Signals derived from a valid AST of a file.
std::string SnippetSuffix
enum clang::clangd::CodeCompleteOptions::CodeCompletionRankingModel RankingModel
llvm::Optional< float > Score
llvm::StringRef PathRef
A typedef to represent a ref to file path.
bool EnableSnippets
When true, completion items will contain expandable code snippets in completion (e....
Represents the signature of a callable.
@ AlwaysParse
Block until we can run the parser (e.g.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::function< DecisionForestScores(const SymbolQualitySignals &, const SymbolRelevanceSignals &, float Base)> DecisionForestScorer
Callback used to score a CompletionCandidate if DecisionForest ranking model is enabled.
llvm::Optional< markup::Document > Documentation
size_t Limit
Limit the number of results returned (0 means no limit).
CompletionPrefix guessCompletionPrefix(llvm::StringRef Content, unsigned Offset)
llvm::Optional< TextEdit > Insertion
llvm::StringRef Qualifier
llvm::Optional< FuzzyFindRequest > CachedReq
A cached request from past code completions.
Attributes of a symbol-query pair that affect how much we like it.
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.
MarkupKind DocumentationFormat
Whether to present doc comments as plain-text or markdown.
A visual indicator to prepend to the completion label to indicate whether completion result would tri...