GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Types | Public Member Functions | Static Public Member Functions | List of all members
gd::ExpressionCompletionDescription Struct Reference

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::StringGetType () const
 Return the type of the completion (same type as types supported in expressions). For properties, this is the type of the property.
 
ExpressionCompletionDescriptionSetType (const gd::String &type_)
 
gd::Variable::Type GetVariableType () const
 Return the type of the variable, for a variable completion.
 
ExpressionCompletionDescriptionSetVariableType (gd::Variable::Type variableType_)
 
const gd::StringGetPrefix () const
 Return the prefix that must be completed.
 
ExpressionCompletionDescriptionSetPrefix (const gd::String &prefix_)
 
const gd::StringGetCompletion () const
 Return the completion that must be inserted.
 
ExpressionCompletionDescriptionSetCompletion (const gd::String &completion_)
 
const gd::StringGetObjectName () const
 Return the object name, if completing an object expression or a behavior.
 
ExpressionCompletionDescriptionSetObjectName (const gd::String &objectName_)
 
const gd::StringGetBehaviorName () const
 Return the behavior name, if completing an object behavior expression. More...
 
ExpressionCompletionDescriptionSetBehaviorName (const gd::String &behaviorName_)
 
ExpressionCompletionDescriptionSetIsExact (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.
 
ExpressionCompletionDescriptionSetIsLastParameter (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.
 
ExpressionCompletionDescriptionSetParameterMetadata (const gd::ParameterMetadata &parameterMetadata_)
 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::ParameterMetadataGetParameterMetadata () const
 Return the parameter metadata, if the completion is about a parameter of a function call. Returns an empty metadata otherwise.
 
ExpressionCompletionDescriptionSetObjectConfiguration (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::ObjectConfigurationGetObjectConfiguration () 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 &parameterMetadata_, 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.
 

Detailed Description

Describe completions to be shown to the user.

Member Enumeration Documentation

◆ CompletionKind

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.

Constructor & Destructor Documentation

◆ ExpressionCompletionDescription()

gd::ExpressionCompletionDescription::ExpressionCompletionDescription ( )
inline

Default constructor, only to be used by Emscripten bindings.

Member Function Documentation

◆ GetBehaviorName()

const gd::String& gd::ExpressionCompletionDescription::GetBehaviorName ( ) const
inline

Return the behavior name, if completing an object behavior expression.

Warning
If completing a behavior, the behavior (partial) name is returned by GetPrefix.

◆ operator==()

bool gd::ExpressionCompletionDescription::operator== ( const ExpressionCompletionDescription other) const
inline

Check if two description of completions are equal


The documentation for this struct was generated from the following files: