GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Describe completions to be shown to the user. More...
#include <ExpressionCompletionFinder.h>
Public Types | |
enum | CompletionKind { Object , BehaviorWithPrefix , ExpressionWithPrefix , Variable , TextWithPrefix , Property , Parameter } |
Public Member Functions | |
bool | operator== (const ExpressionCompletionDescription &other) const |
CompletionKind | GetCompletionKind () const |
Return the kind of the completion. | |
const gd::String & | GetType () const |
Return the type of the completion (same type as types supported in expressions). For properties, this is the type of the property. | |
ExpressionCompletionDescription & | SetType (const gd::String &type_) |
gd::Variable::Type | GetVariableType () const |
Return the type of the variable, for a variable completion. | |
ExpressionCompletionDescription & | SetVariableType (gd::Variable::Type variableType_) |
gd::VariablesContainer::SourceType | GetVariableScope () const |
Return the scope of the variable, for a variable completion. | |
ExpressionCompletionDescription & | SetVariableScope (gd::VariablesContainer::SourceType variableScope_) |
const gd::String & | GetPrefix () const |
Return the prefix that must be completed. | |
ExpressionCompletionDescription & | SetPrefix (const gd::String &prefix_) |
const gd::String & | GetCompletion () const |
Return the completion that must be inserted. | |
ExpressionCompletionDescription & | SetCompletion (const gd::String &completion_) |
const gd::String & | GetObjectName () const |
Return the object name, if completing an object expression or a behavior. | |
ExpressionCompletionDescription & | SetObjectName (const gd::String &objectName_) |
const gd::String & | GetBehaviorName () const |
Return the behavior name, if completing an object behavior expression. More... | |
ExpressionCompletionDescription & | SetBehaviorName (const gd::String &behaviorName_) |
ExpressionCompletionDescription & | SetIsExact (bool isExact_) |
Set if the completion description is exact, i.e: it's not used to complete anything. Rather, it should display information about what is described by the completion. | |
bool | IsExact () const |
Check if the completion description is exact, i.e: it's not used to complete anything. Rather, it should display information about what is described by the completion. | |
size_t | GetReplacementStartPosition () const |
Return the first character index of the autocompleted part. | |
size_t | GetReplacementEndPosition () const |
Return the first character index after the autocompleted part. | |
ExpressionCompletionDescription & | SetIsLastParameter (bool isLastParameter_) |
Set if the expression is the last child of a function call. | |
bool | IsLastParameter () const |
Check if the expression is the last child of a function call. | |
ExpressionCompletionDescription & | SetParameterMetadata (const gd::ParameterMetadata ¶meterMetadata_) |
Set the parameter metadata, in the case the completion is about a parameter of a function call. | |
bool | HasParameterMetadata () const |
Check if the completion is about a parameter of a function call. | |
const gd::ParameterMetadata & | GetParameterMetadata () const |
Return the parameter metadata, if the completion is about a parameter of a function call. Returns an empty metadata otherwise. | |
ExpressionCompletionDescription & | SetObjectConfiguration (const gd::ObjectConfiguration *objectConfiguration_) |
Set the object configuration, in the case the completion is about an object. | |
bool | HasObjectConfiguration () const |
Check if the completion is about an object. | |
const gd::ObjectConfiguration & | GetObjectConfiguration () const |
Return the parameter metadata, if the completion is about a object. Returns an empty configuration otherwise. | |
gd::String | ToString () const |
ExpressionCompletionDescription () | |
ExpressionCompletionDescription (CompletionKind completionKind_, size_t replacementStartPosition_, size_t replacementEndPosition_) | |
Static Public Member Functions | |
static ExpressionCompletionDescription | ForBehaviorWithPrefix (const gd::String &prefix_, size_t replacementStartPosition_, size_t replacementEndPosition_, const gd::String &objectName_) |
Create a completion for a behavior with the given prefix, for the specified object. | |
static ExpressionCompletionDescription | ForTextWithPrefix (const gd::String &type_, const gd::ParameterMetadata ¶meterMetadata_, const gd::String &prefix_, size_t replacementStartPosition_, size_t replacementEndPosition_, const bool isLastParameter_, const gd::String &objectName_="") |
Create a completion for a text with the given prefix. | |
static ExpressionCompletionDescription | ForExpressionWithPrefix (const gd::String &type_, const gd::String &prefix_, size_t replacementStartPosition_, size_t replacementEndPosition_, const gd::String &objectName_="", const gd::String &behaviorName_="") |
Create a completion for an expression (free, object or behavior expression) with the given prefix. | |
Describe completions to be shown to the user.
The different kind of completions that can be described. The IDE is responsible for actually searching and showing the completions of completions with a kind "WithPrefix": these completions are only describing what must be listed.
|
inline |
Default constructor, only to be used by Emscripten bindings.
|
inline |
Return the behavior name, if completing an object behavior expression.
GetPrefix
.
|
inline |
Check if two description of completions are equal