:github_url: hide .. _class_SyntaxHighlighter: SyntaxHighlighter ================= **Hereda:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Heredado por:** :ref:`CodeHighlighter`, :ref:`EditorSyntaxHighlighter` Clase base para los resaltadores de sintaxis. Proporciona datos de resaltado de sintaxis a un :ref:`TextEdit`. .. rst-class:: classref-introduction-group Descripción ---------------------- Clase base para los resaltadores de sintaxis. Proporciona datos de resaltado de sintaxis a un :ref:`TextEdit`. El :ref:`TextEdit` asociado llamará al **SyntaxHighlighter** cuando sea necesario. \ **Nota:** Una instancia de **SyntaxHighlighter** no debe ser usada a través de múltiples nodos :ref:`TextEdit`. .. rst-class:: classref-reftable-group Métodos -------------- .. table:: :widths: auto +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_clear_highlighting_cache`\ (\ ) |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`_get_line_syntax_highlighting`\ (\ line\: :ref:`int`\ ) |virtual| |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_update_cache`\ (\ ) |virtual| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`clear_highlighting_cache`\ (\ ) | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_line_syntax_highlighting`\ (\ line\: :ref:`int`\ ) | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TextEdit` | :ref:`get_text_edit`\ (\ ) |const| | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`update_cache`\ (\ ) | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Descripciones de Métodos ------------------------------------------------ .. _class_SyntaxHighlighter_private_method__clear_highlighting_cache: .. rst-class:: classref-method |void| **_clear_highlighting_cache**\ (\ ) |virtual| :ref:`🔗` Método virtual que puede ser sobreescrito para limpiar cualquier caché local. .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_private_method__get_line_syntax_highlighting: .. rst-class:: classref-method :ref:`Dictionary` **_get_line_syntax_highlighting**\ (\ line\: :ref:`int`\ ) |virtual| |const| :ref:`🔗` Método virtual que puede ser sobreescrito para devolver datos de resaltado de sintaxis. Véase :ref:`get_line_syntax_highlighting()` para más detalles. .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_private_method__update_cache: .. rst-class:: classref-method |void| **_update_cache**\ (\ ) |virtual| :ref:`🔗` Método virtual que puede ser sobreescrito para actualizar cualquier caché local. .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_method_clear_highlighting_cache: .. rst-class:: classref-method |void| **clear_highlighting_cache**\ (\ ) :ref:`🔗` Limpia todos los datos de resaltado de sintaxis cacheados. Luego llama al método sobrescribible :ref:`_clear_highlighting_cache()`. .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_method_get_line_syntax_highlighting: .. rst-class:: classref-method :ref:`Dictionary` **get_line_syntax_highlighting**\ (\ line\: :ref:`int`\ ) :ref:`🔗` Returns the syntax highlighting data for the line at index ``line``. If the line is not cached, calls :ref:`_get_line_syntax_highlighting()` first to calculate the data. Each entry is a column number containing a nested :ref:`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 :ref:`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) } } .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_method_get_text_edit: .. rst-class:: classref-method :ref:`TextEdit` **get_text_edit**\ (\ ) |const| :ref:`🔗` Devuelve el nodo :ref:`TextEdit` asociado. .. rst-class:: classref-item-separator ---- .. _class_SyntaxHighlighter_method_update_cache: .. rst-class:: classref-method |void| **update_cache**\ (\ ) :ref:`🔗` Limpia y luego actualiza las cachés de **SyntaxHighlighter**. Sobrescribe :ref:`_update_cache()` para una devolución de llamada. \ **Nota:** Esto se llama automáticamente cuando el nodo :ref:`TextEdit` asociado actualiza su propia caché. .. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)` .. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)` .. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)` .. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)` .. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)` .. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)` .. |void| replace:: :abbr:`void (Sin valor de retorno.)`