Documentation
¶
Overview ¶
Package SyntaxHighlighter provides methods for working with SyntaxHighlighter object instances.
Index ¶
- type Advanced
- type Any
- type Entry
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsSyntaxHighlighter() Instance
- func (self Instance) ClearHighlightingCache()
- func (self Instance) GetLineSyntaxHighlighting(line int) map[int]Entry
- func (self Instance) GetTextEdit() TextEdit.Instance
- func (self Instance) ID() ID
- func (self Instance) Set(peer TextEdit.Instance)
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) UpdateCache()
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
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 Extension ¶
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
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
func (*Extension[T]) AsSyntaxHighlighter ¶
type 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.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.SyntaxHighlighter
Base class for syntax highlighters. Provides syntax highlighting data to a [TextEdit]. The associated [TextEdit] will call into the [SyntaxHighlighter] on an as-needed basis. [b]Note:[/b] A [SyntaxHighlighter] instance should not be used across multiple [TextEdit] nodes.
See [Interface] for methods that can be overridden by a [Class] that extends it.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsSyntaxHighlighter ¶
func (Instance) ClearHighlightingCache ¶
func (self Instance) ClearHighlightingCache()
Clears all cached syntax highlighting data. Then calls overridable method [method _clear_highlighting_cache].
func (Instance) GetLineSyntaxHighlighting ¶
Returns the syntax highlighting data for the line at index [param line]. If the line is not cached, calls [method _get_line_syntax_highlighting] first to calculate the data. Each entry is a column number containing a nested [Dictionary]. The column number denotes the start of a region, the region will end if another region is found, or at the end of the line. The nested [Dictionary] contains the data for that region. Currently only the key [code]"color"[/code] is supported. [b]Example:[/b] Possible return value. This means columns [code]0[/code] to [code]4[/code] should be red, and columns [code]5[/code] to the end of the line should be green: [codeblock]
{ 0: { "color": Color(1, 0, 0) }, 5: { "color": Color(0, 1, 0) } }
[/codeblock]
func (Instance) GetTextEdit ¶
Returns the associated [TextEdit] node.
func (*Instance) UnsafePointer ¶
func (Instance) UpdateCache ¶
func (self Instance) UpdateCache()
Clears then updates the [SyntaxHighlighter] caches. Override [method _update_cache] for a callback. [b]Note:[/b] This is called automatically when the associated [TextEdit] node, updates its own cache.
type Interface ¶
type Interface interface { //Virtual method which can be overridden to return syntax highlighting data. //See [method get_line_syntax_highlighting] for more details. GetLineSyntaxHighlighting(line int) map[any]any //Virtual method which can be overridden to clear any local caches. ClearHighlightingCache() //Virtual method which can be overridden to update any local caches. UpdateCache() }