2020-07-15 06:43:21 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-03-01 00:44:37 +00:00
<class name= "SyntaxHighlighter" inherits= "Resource" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2020-07-15 06:43:21 +00:00
<brief_description >
2023-04-30 14:26:09 +00:00
Base class for syntax highlighters. Provides syntax highlighting data to a [TextEdit].
2020-07-15 06:43:21 +00:00
</brief_description>
<description >
2023-04-30 14:26:09 +00:00
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.
2020-07-15 06:43:21 +00:00
</description>
<tutorials >
</tutorials>
<methods >
2020-10-11 16:07:33 +00:00
<method name= "_clear_highlighting_cache" qualifiers= "virtual" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2020-10-11 16:07:33 +00:00
<description >
2021-02-08 11:34:28 +00:00
Virtual method which can be overridden to clear any local caches.
2020-10-11 16:07:33 +00:00
</description>
</method>
2021-08-22 01:52:44 +00:00
<method name= "_get_line_syntax_highlighting" qualifiers= "virtual const" >
2021-07-30 13:28:05 +00:00
<return type= "Dictionary" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "line" type= "int" />
2020-07-15 06:43:21 +00:00
<description >
2020-10-11 16:07:33 +00:00
Virtual method which can be overridden to return syntax highlighting data.
See [method get_line_syntax_highlighting] for more details.
2020-07-15 06:43:21 +00:00
</description>
</method>
<method name= "_update_cache" qualifiers= "virtual" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2020-07-15 06:43:21 +00:00
<description >
2021-02-08 11:34:28 +00:00
Virtual method which can be overridden to update any local caches.
2020-07-15 06:43:21 +00:00
</description>
</method>
<method name= "clear_highlighting_cache" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2020-07-15 06:43:21 +00:00
<description >
2020-10-11 16:07:33 +00:00
Clears all cached syntax highlighting data.
Then calls overridable method [method _clear_highlighting_cache].
2020-07-15 06:43:21 +00:00
</description>
</method>
<method name= "get_line_syntax_highlighting" >
2021-07-30 13:28:05 +00:00
<return type= "Dictionary" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "line" type= "int" />
2020-07-15 06:43:21 +00:00
<description >
2020-10-11 16:07:33 +00:00
Returns syntax highlighting data for a single line. If the line is not cached, calls [method _get_line_syntax_highlighting] to calculate the data.
The return [Dictionary] is column number to [Dictionary]. The column number notes 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 "color" is supported.
[b]Example return:[/b]
[codeblock]
var color_map = {
0: {
"color": Color(1, 0, 0)
},
5: {
"color": Color(0, 1, 0)
}
}
[/codeblock]
This will color columns 0-4 red, and columns 5-eol in green.
2020-07-15 06:43:21 +00:00
</description>
</method>
2023-04-07 18:16:50 +00:00
<method name= "get_text_edit" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "TextEdit" />
2020-07-15 06:43:21 +00:00
<description >
2020-10-11 16:07:33 +00:00
Returns the associated [TextEdit] node.
2020-07-15 06:43:21 +00:00
</description>
</method>
<method name= "update_cache" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2020-07-15 06:43:21 +00:00
<description >
2020-10-11 16:07:33 +00:00
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.
2020-07-15 06:43:21 +00:00
</description>
</method>
</methods>
</class>