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/SmallVector.h"
30#include "llvm/ADT/StringRef.h"
248 CodeCompletionContext::Kind
Context = CodeCompletionContext::CCC_Other;
const ParseInputs & ParseInput
std::optional< float > Score
A context is an immutable container for per-request data that must be propagated through layers that ...
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
An immutable symbol container that stores a set of symbols.
CompletionPrefix guessCompletionPrefix(llvm::StringRef Content, unsigned Offset)
CompletionItemKind
The kind of a completion entry.
bool allowImplicitCompletion(llvm::StringRef Content, unsigned Offset)
DecisionForestScores evaluateDecisionForest(const SymbolQualitySignals &Quality, const SymbolRelevanceSignals &Relevance, float Base)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
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.
llvm::StringRef PathRef
A typedef to represent a ref to file path.
SignatureHelp signatureHelp(PathRef FileName, Position Pos, const PreambleData &Preamble, const ParseInputs &ParseInput, MarkupKind DocumentationFormat)
Get signature help at a specified Pos in FileName.
bool isIndexedForCodeCompletion(const NamedDecl &ND, ASTContext &ASTCtx)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Signals derived from a valid AST of a file.
A visual indicator to prepend to the completion label to indicate whether completion result would tri...
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...
CodeCompletionParse
Whether to use the clang parser, or fallback to text-based completion (using identifiers in the curre...
@ AlwaysParse
Block until we can run the parser (e.g.
@ ParseIfReady
Run the parser if inputs (preamble) are ready.
@ NeverParse
Always use text-based completion.
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.
static const CodeCompletionRankingModel DefaultRankingModel
bool IncludeIneligibleResults
Include results that are not legal completions in the current context.
const SymbolIndex * Index
If Index is set, it is used to augment the code completion results.
CodeCompletionRankingModel
Model to use for ranking code completion candidates.
const ASTSignals * MainFileSignals
std::function< DecisionForestScores(const SymbolQualitySignals &, const SymbolRelevanceSignals &, float Base)> DecisionForestScorer
Callback used to score a CompletionCandidate if DecisionForest ranking model is enabled.
CodeCompletionRankingModel RankingModel
enum clang::clangd::CodeCompleteOptions::IncludeInsertion InsertIncludes
bool ImportInsertions
Whether include insertions for Objective-C code should use #import instead of #include.
bool AllScopes
Whether to include index symbols that are not defined in the scopes visible from the code completion ...
bool EnableFunctionArgSnippets
Whether to generate snippets for function arguments on code-completion.
float DecisionForestBase
Weight for combining NameMatch and Prediction of DecisionForest.
size_t Limit
Limit the number of results returned (0 means no limit).
std::optional< bool > BundleOverloads
Combine overloads into a single completion item where possible.
bool IncludeFixIts
Include completions that require small corrections, e.g.
struct clang::clangd::CodeCompleteOptions::IncludeInsertionIndicator IncludeIndicator
bool EnableSnippets
When true, completion items will contain expandable code snippets in completion (e....
enum clang::clangd::CodeCompleteOptions::CodeCompletionParse RunParser
bool ShowOrigins
Expose origins of completion items in the label (for debugging).
std::vector< CodeCompletion > Completions
std::optional< Range > CompletionRange
std::optional< TextEdit > Insertion
std::optional< markup::Document > Documentation
llvm::SmallVector< IncludeCandidate, 1 > Includes
bool Deprecated
Indicates if this item is deprecated.
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.
std::string SnippetSuffix
CompletionItem render(const CodeCompleteOptions &) const
std::string RequiredQualifier
llvm::StringRef Qualifier
Same semantics as CodeComplete::Score.
The parsed preamble and associated data.
Represents the signature of a callable.
A speculative and asynchronous fuzzy find index request (based on cached request) that can be sent be...
std::optional< FuzzyFindRequest > CachedReq
A cached request from past code completions.
std::future< std::pair< bool, SymbolSlab > > Result
The result is consumed by codeComplete() if speculation succeeded.
std::optional< FuzzyFindRequest > NewReq
The actual request used by codeComplete().
Attributes of a symbol that affect how much we like it.
Attributes of a symbol-query pair that affect how much we like it.