SyntaxHighlighter
Hereda: Resource < RefCounted < Object
Heredado por: CodeHighlighter, EditorSyntaxHighlighter
Clase base para los resaltadores de sintaxis. Proporciona datos de resaltado de sintaxis a un TextEdit.
Descripción
Clase base para los resaltadores de sintaxis. Proporciona datos de resaltado de sintaxis a un TextEdit. El TextEdit asociado llamará al SyntaxHighlighter cuando sea necesario.
Nota: Una instancia de SyntaxHighlighter no debe ser usada a través de múltiples nodos TextEdit.
Métodos
void |
_clear_highlighting_cache() virtual |
_get_line_syntax_highlighting(line: int) virtual const |
|
void |
_update_cache() virtual |
void |
|
get_line_syntax_highlighting(line: int) |
|
get_text_edit() const |
|
void |
Descripciones de Métodos
void _clear_highlighting_cache() virtual 🔗
Método virtual que puede ser sobreescrito para limpiar cualquier caché local.
Dictionary _get_line_syntax_highlighting(line: int) virtual const 🔗
Método virtual que puede ser sobreescrito para devolver datos de resaltado de sintaxis.
Véase get_line_syntax_highlighting() para más detalles.
void _update_cache() virtual 🔗
Método virtual que puede ser sobreescrito para actualizar cualquier caché local.
void clear_highlighting_cache() 🔗
Limpia todos los datos de resaltado de sintaxis cacheados.
Luego llama al método sobrescribible _clear_highlighting_cache().
Dictionary get_line_syntax_highlighting(line: int) 🔗
Returns the syntax highlighting data for the line at index line. If the line is not cached, calls _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 "color" is supported.
Example: Possible return value. This means columns 0 to 4 should be red, and columns 5 to the end of the line should be green:
{
0: {
"color": Color(1, 0, 0)
},
5: {
"color": Color(0, 1, 0)
}
}
TextEdit get_text_edit() const 🔗
Devuelve el nodo TextEdit asociado.
void update_cache() 🔗
Limpia y luego actualiza las cachés de SyntaxHighlighter. Sobrescribe _update_cache() para una devolución de llamada.
Nota: Esto se llama automáticamente cuando el nodo TextEdit asociado actualiza su propia caché.