ScriptLanguageExtension

package
v0.0.0-...-fa94a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsScriptLanguageExtension() Instance
}

type ClassName

type ClassName struct {
	Name       string `gd:"name"`
	BaseType   string `gd:"base_type"`
	IconPath   string `gd:"icon_path"`
	IsAbstract bool   `gd:"is_abstract"`
	IsTool     bool   `gd:"is_tool"`
}

type Code

type Code struct {
	Result              Error.Code      `gd:"result"`
	Type                int             `gd:"type"`
	ClassName           string          `gd:"class_name"`
	ClassMember         string          `gd:"class_member"`
	Description         string          `gd:"description"`
	IsDeprecated        bool            `gd:"is_deprecated"`
	DeprecatedMessage   string          `gd:"deprecated_message"`
	IsExperimental      bool            `gd:"is_experimental"`
	ExperimentalMessage string          `gd:"experimental_message"`
	DocType             string          `gd:"doc_type"`
	Enumeration         string          `gd:"enumeration"`
	IsBitfield          bool            `gd:"is_bitfield"`
	Value               string          `gd:"value"`
	Script              Script.Instance `gd:"script"`
	ScriptPath          string          `gd:"script_path"`
	Location            int             `gd:"location"`
}

type CodeCompletionKind

type CodeCompletionKind int //gd:ScriptLanguageExtension.CodeCompletionKind
const (
	CodeCompletionKindClass     CodeCompletionKind = 0
	CodeCompletionKindFunction  CodeCompletionKind = 1
	CodeCompletionKindSignal    CodeCompletionKind = 2
	CodeCompletionKindVariable  CodeCompletionKind = 3
	CodeCompletionKindMember    CodeCompletionKind = 4
	CodeCompletionKindEnum      CodeCompletionKind = 5
	CodeCompletionKindConstant  CodeCompletionKind = 6
	CodeCompletionKindNodePath  CodeCompletionKind = 7
	CodeCompletionKindFilePath  CodeCompletionKind = 8
	CodeCompletionKindPlainText CodeCompletionKind = 9
	CodeCompletionKindMax       CodeCompletionKind = 10
)

type CodeCompletionLocation

type CodeCompletionLocation int //gd:ScriptLanguageExtension.CodeCompletionLocation
const (
	// The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes).
	LocationLocal CodeCompletionLocation = 0
	// The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc.) to store the depth of an option in the class or a parent class.
	LocationParentMask CodeCompletionLocation = 256
	// The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons).
	LocationOtherUserCode CodeCompletionLocation = 512
	// The option is from other engine code, not covered by the other enum constants - e.g. built-in classes.
	LocationOther CodeCompletionLocation = 1024
)

type Completion

type Completion struct {
	Kind       CodeCompletionKind `gd:"kind"`
	Display    string             `gd:"display"`
	InsertText string             `gd:"insert_text"`
	FontColor  struct {
		R float32
		G float32
		B float32
		A float32
	} `gd:"font_color"`
	Icon         string     `gd:"icon"`
	DefaultValue string     `gd:"default_value"`
	Location     string     `gd:"location"`
	Matches      []int32    `gd:"matches"`
	Force        bool       `gd:"force"`
	CallHint     string     `gd:"call_hint"`
	Result       Error.Code `gd:"result"`
}

type Constant

type Constant struct {
	Name  string      `gd:"name"`
	Value interface{} `gd:"value"`
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsScriptLanguage

func (self *Extension[T]) AsScriptLanguage() ScriptLanguage.Instance

func (*Extension[T]) AsScriptLanguageExtension

func (self *Extension[T]) AsScriptLanguageExtension() Instance

type Globals

type Globals struct {
	Globals []string      `gd:"globals"`
	Values  []interface{} `gd:"values"`
}

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.ScriptLanguageExtension

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsScriptLanguage

func (self Instance) AsScriptLanguage() ScriptLanguage.Instance

func (Instance) AsScriptLanguageExtension

func (self Instance) AsScriptLanguageExtension() Instance

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	GetName() string
	Init()
	GetType() string
	GetExtension() string
	Finish()
	GetReservedWords() []string
	IsControlFlowKeyword(keyword string) bool
	GetCommentDelimiters() []string
	GetDocCommentDelimiters() []string
	GetStringDelimiters() []string
	MakeTemplate(template string, class_name string, base_class_name string) Script.Instance
	GetBuiltInTemplates(obj string) [][]Template
	IsUsingTemplates() bool
	Validate(script string, path string, validate_functions bool, validate_errors bool, validate_warnings bool, validate_safe_lines bool) Validation
	ValidatePath(path string) string
	CreateScript() Object.Instance
	HasNamedClasses() bool
	SupportsBuiltinMode() bool
	SupportsDocumentation() bool
	CanInheritFromFile() bool
	// Returns the line where the function is defined in the code, or -1 if the function is not present.
	FindFunction(function string, code string) int
	MakeFunction(class_name string, function_name string, function_args []string) string
	CanMakeFunction() bool
	OpenInExternalEditor(script Script.Instance, line int, column int) error
	OverridesExternalEditor() bool
	PreferredFileNameCasing() ScriptLanguage.ScriptNameCasing
	CompleteCode(code string, path string, owner Object.Instance) Completion
	LookupCode(code string, symbol string, path string, owner Object.Instance) Code
	AutoIndentCode(code string, from_line int, to_line int) string
	AddGlobalConstant(name string, value any)
	AddNamedGlobalConstant(name string, value any)
	RemoveNamedGlobalConstant(name string)
	ThreadEnter()
	ThreadExit()
	DebugGetError() string
	DebugGetStackLevelCount() int
	DebugGetStackLevelLine(level int) int
	DebugGetStackLevelFunction(level int) string
	// Returns the source associated with a given debug stack position.
	DebugGetStackLevelSource(level int) string
	DebugGetStackLevelLocals(level int, max_subitems int, max_depth int) StackLevelLocals
	DebugGetStackLevelMembers(level int, max_subitems int, max_depth int) StackLevelMembers
	DebugGetStackLevelInstance(level int) gdextension.Pointer
	DebugGetGlobals(max_subitems int, max_depth int) Globals
	DebugParseStackLevelExpression(level int, expression string, max_subitems int, max_depth int) string
	DebugGetCurrentStackInfo() []StackInfo
	ReloadAllScripts()
	ReloadScripts(scripts []Script.Instance, soft_reload bool)
	ReloadToolScript(script Script.Instance, soft_reload bool)
	GetRecognizedExtensions() []string
	GetPublicFunctions() [][]struct{}
	GetPublicConstants() []Constant
	GetPublicAnnotations() [][]struct{}
	ProfilingStart()
	ProfilingStop()
	ProfilingSetSaveNativeCalls(enable bool)
	ProfilingGetAccumulatedData(info_array *ProfilingInfo, info_max int) int
	ProfilingGetFrameData(info_array *ProfilingInfo, info_max int) int
	Frame()
	HandlesGlobalClassType(atype string) bool
	GetGlobalClassName(path string) ClassName
}

type LookupResultType

type LookupResultType int //gd:ScriptLanguageExtension.LookupResultType
const (
	LookupResultScriptLocation      LookupResultType = 0
	LookupResultClass               LookupResultType = 1
	LookupResultClassConstant       LookupResultType = 2
	LookupResultClassProperty       LookupResultType = 3
	LookupResultClassMethod         LookupResultType = 4
	LookupResultClassSignal         LookupResultType = 5
	LookupResultClassEnum           LookupResultType = 6
	LookupResultClassTbdGlobalscope LookupResultType = 7
	LookupResultClassAnnotation     LookupResultType = 8
	LookupResultLocalConstant       LookupResultType = 9
	LookupResultLocalVariable       LookupResultType = 10
	LookupResultMax                 LookupResultType = 11
)

type StackInfo

type StackInfo struct {
	File string `gd:"file"`
	Func string `gd:"func"`
	Line int    `gd:"line"`
}

type StackLevelLocals

type StackLevelLocals struct {
	Locals []string      `gd:"locals"`
	Values []interface{} `gd:"values"`
}

type StackLevelMembers

type StackLevelMembers struct {
	Members []string      `gd:"members"`
	Values  []interface{} `gd:"values"`
}

type Template

type Template struct {
	Inherit     string           `gd:"inherit"`
	Name        string           `gd:"name"`
	Description string           `gd:"description"`
	Content     string           `gd:"content"`
	ID          int32            `gd:"id"`
	Origin      TemplateLocation `gd:"origin"`
}

type TemplateLocation

type TemplateLocation int
const (
	TemplateBuiltIn TemplateLocation = iota
	TemplateEditor
	TemplateProject
)

type Validation

type Validation struct {
	Functions []string          `gd:"functions"`
	Errors    []ValidationError `gd:"errors"`
	Warnings  []Warning         `gd:"warnings"`
	SafeLines []int32           `gd:"safe_lines"`
	Valid     bool              `gd:"valid"`
}

type ValidationError

type ValidationError struct {
	Line    int    `gd:"line"`
	Column  int    `gd:"column"`
	Message string `gd:"message"`
	Path    string `gd:"path"`
}

type Warning

type Warning struct {
	StartLine       int    `gd:"start_line"`
	EndLine         int    `gd:"end_line"`
	LeftMostColumn  int    `gd:"left_most_column"`
	RightMostColumn int    `gd:"right_most_column"`
	Code            int    `gd:"code"`
	StringCode      string `gd:"string_code"`
	Message         string `gd:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL