Captures a result of code completion. More...
#include "clang/Sema/CodeCompleteConsumer.h"
Captures a result of code completion.
Definition at line 760 of file CodeCompleteConsumer.h.
◆ ResultKindDescribes the kind of result generated.
Enumerator RK_DeclarationRefers to a declaration.
RK_KeywordRefers to a keyword or symbol.
RK_MacroRefers to a macro.
RK_PatternRefers to a precomputed pattern.
Definition at line 763 of file CodeCompleteConsumer.h.
◆ CodeCompletionResult() [1/5] ◆ CodeCompletionResult() [2/5] clang::CodeCompletionResult::CodeCompletionResult ( const char * Keyword, unsigned Priority =CCP_Keyword
) inline ◆ CodeCompletionResult() [3/5] ◆ CodeCompletionResult() [4/5] ◆ CodeCompletionResult() [5/5]
Build a result that refers to a pattern with an associated declaration.
Definition at line 930 of file CodeCompleteConsumer.h.
◆ CreateCodeCompletionString() [1/2]If possible, create a new code completion string for the given result.
Definition at line 3576 of file SemaCodeComplete.cpp.
References Availability, createCodeCompletionStringForDecl(), CreateCodeCompletionStringForMacro(), Declaration, getCompletionPrintingPolicy(), clang::Decl::getDeclContext(), clang::getPatternCompletionComment(), Keyword, Kind, Pattern, Priority, clang::Result, RK_Declaration, RK_Keyword, RK_Macro, and RK_Pattern.
◆ CreateCodeCompletionString() [2/2] ◆ createCodeCompletionStringForDecl()Definition at line 3663 of file SemaCodeComplete.cpp.
References AddFunctionParameterChunks(), AddFunctionTypeQualsToCompletionString(), AddQualifierToCompletionString(), AddResultTypeChunk(), AddTemplateParameterChunks(), AddTypedNameChunk(), AllParametersAreInformative, clang::CodeCompletionString::CK_HorizontalSpace, clang::CodeCompletionString::CK_LeftAngle, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightAngle, clang::CodeCompletionString::CK_RightParen, Declaration, DeclaringEntity, extractFunctorCallOperator(), FormatFunctionParameter(), formatObjCParamQualifiers(), clang::Function, FunctionCanBeCall, clang::QualType::getAsString(), clang::CodeCompletionContext::getBaseType(), clang::getCompletionComment(), clang::Decl::getDeclContext(), clang::Selector::getIdentifierInfoForSlot(), clang::NamedDecl::getNameAsString(), clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), clang::Type::getObjCSubstitutions(), clang::Type::isBlockPointerType(), clang::QualType::isNull(), clang::Selector::isUnarySelector(), clang::FunctionDecl::isVariadic(), Keyword, clang::Sema::MarkDeducedTemplateParameters(), MaybeAddSentinel(), P, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_end(), clang::FunctionDecl::param_size(), clang::Parameter, Qualifier, QualifierIsInformative, clang::Result, clang::Decl::specific_attrs(), StartParameter, StartsNestedNameSpecifier, and clang::QualType::substObjCTypeArgs().
Referenced by CreateCodeCompletionString(), and createCodeCompletionStringForOverride().
◆ CreateCodeCompletionStringForMacro()Creates a new code-completion string for the macro result.
Similar to the above overloads, except this only requires preprocessor information. The result kind must be RK_Macro
.
Definition at line 3524 of file SemaCodeComplete.cpp.
References Availability, clang::CodeCompletionString::CK_Comma, clang::CodeCompletionString::CK_LeftParen, clang::CodeCompletionString::CK_RightParen, clang::Preprocessor::getMacroInfo(), clang::IdentifierInfo::getName(), clang::MacroInfo::isC99Varargs(), clang::MacroInfo::isFunctionLike(), clang::MacroInfo::isVariadic(), Kind, Macro, clang::MacroInfo::param_begin(), clang::MacroInfo::param_end(), Priority, clang::Result, and RK_Macro.
Referenced by CreateCodeCompletionString().
◆ createCodeCompletionStringForOverride() ◆ getDeclaration() const NamedDecl * clang::CodeCompletionResult::getDeclaration ( ) const inline ◆ getKeyword() const char * clang::CodeCompletionResult::getKeyword ( ) const inline ◆ getOrderedName() StringRef CodeCompletionResult::getOrderedName ( std::string & Saved ) const ◆ union { ... } clang::CodeCompletionResult::@216 ◆ AllParametersAreInformative bool clang::CodeCompletionResult::AllParametersAreInformative ◆ Availability ◆ CursorKind ◆ Declaration const NamedDecl* clang::CodeCompletionResult::Declaration = nullptr ◆ DeclaringEntity bool clang::CodeCompletionResult::DeclaringEntity ◆ FixIts std::vector<FixItHint> clang::CodeCompletionResult::FixItsFix-its that must be applied before inserting the text for the corresponding completion.
By default, CodeCompletionBuilder only returns completions with empty fix-its. Extra completions with non-empty fix-its should be explicitly requested by setting CompletionOptions::IncludeFixIts.
For the clients to be able to compute position of the cursor after applying fix-its, the following conditions are guaranteed to hold for RemoveRange of the stored fix-its:
The intuition is that provided fix-its change code around the identifier we complete, but are not allowed to touch the identifier itself or the completion point. One example of completions with corrections are the ones replacing '.' with '->' and vice versa:
std::unique_ptr<std::vector<int>> vec_ptr; In 'vec_ptr.^', one of the completions is 'push_back', it requires replacing '.' with '->'. In 'vec_ptr->^', one of the completions is 'release', it requires replacing '->' with '.'.
Definition at line 838 of file CodeCompleteConsumer.h.
◆ FunctionCanBeCall bool clang::CodeCompletionResult::FunctionCanBeCallWhen completing a function, whether it can be a call.
This will usually be true, but we have some heuristics, e.g. when a pointer to a non-static member function is completed outside of that class' scope, it can never be a call.
Definition at line 865 of file CodeCompleteConsumer.h.
Referenced by createCodeCompletionStringForDecl().
◆ Hidden bool clang::CodeCompletionResult::Hidden ◆ InBaseClass bool clang::CodeCompletionResult::InBaseClass ◆ Keyword const char* clang::CodeCompletionResult::Keyword ◆ Kind ◆ Macro ◆ MacroDefInfo const MacroInfo* clang::CodeCompletionResult::MacroDefInfo = nullptrIf the result is RK_Macro, this can store the information about the macro definition.
This should be set in most cases but can be missing when the macro has been undefined.
Definition at line 881 of file CodeCompleteConsumer.h.
◆ Pattern ◆ Priority unsigned clang::CodeCompletionResult::Priority ◆ Qualifier ◆ QualifierIsInformative bool clang::CodeCompletionResult::QualifierIsInformative ◆ ShadowDeclIf this Decl was unshadowed by using declaration, this can store a pointer to the UsingShadowDecl which was used in the unshadowing process.
This information can be used to uprank CodeCompletionResults / which have corresponding using decl::qualified::name;
nearby.
Definition at line 876 of file CodeCompleteConsumer.h.
◆ StartParameter unsigned clang::CodeCompletionResult::StartParameter = 0 ◆ StartsNestedNameSpecifier bool clang::CodeCompletionResult::StartsNestedNameSpecifierThe documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4