:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ScriptEditor.xml. .. _class_ScriptEditor: ScriptEditor ============ **Inherits:** :ref:`PanelContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Godot editor's script editor. .. rst-class:: classref-introduction-group Description ----------- Godot editor's script editor. \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_script_editor`. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedStringArray` | :ref:`get_breakpoints`\ (\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ScriptEditorBase` | :ref:`get_current_editor`\ (\ ) |const| | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Script` | :ref:`get_current_script`\ (\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`ScriptEditorBase`\] | :ref:`get_open_script_editors`\ (\ ) |const| | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Script`\] | :ref:`get_open_scripts`\ (\ ) |const| | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`goto_help`\ (\ topic\: :ref:`String`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`goto_line`\ (\ line_number\: :ref:`int`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`open_script_create_dialog`\ (\ base_name\: :ref:`String`, base_path\: :ref:`String`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`register_syntax_highlighter`\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`unregister_syntax_highlighter`\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`update_docs_from_script`\ (\ script\: :ref:`Script`\ ) | +------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_ScriptEditor_signal_editor_script_changed: .. rst-class:: classref-signal **editor_script_changed**\ (\ script\: :ref:`Script`\ ) :ref:`🔗` Emitted when user changed active script. Argument is a freshly activated :ref:`Script`. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_signal_script_close: .. rst-class:: classref-signal **script_close**\ (\ script\: :ref:`Script`\ ) :ref:`🔗` Emitted when editor is about to close the active script. Argument is a :ref:`Script` that is going to be closed. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ScriptEditor_method_get_breakpoints: .. rst-class:: classref-method :ref:`PackedStringArray` **get_breakpoints**\ (\ ) :ref:`🔗` Returns array of breakpoints. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_get_current_editor: .. rst-class:: classref-method :ref:`ScriptEditorBase` **get_current_editor**\ (\ ) |const| :ref:`🔗` Returns the :ref:`ScriptEditorBase` object that the user is currently editing. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_get_current_script: .. rst-class:: classref-method :ref:`Script` **get_current_script**\ (\ ) :ref:`🔗` Returns a :ref:`Script` that is currently active in editor. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_get_open_script_editors: .. rst-class:: classref-method :ref:`Array`\[:ref:`ScriptEditorBase`\] **get_open_script_editors**\ (\ ) |const| :ref:`🔗` Returns an array with all :ref:`ScriptEditorBase` objects which are currently open in editor. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_get_open_scripts: .. rst-class:: classref-method :ref:`Array`\[:ref:`Script`\] **get_open_scripts**\ (\ ) |const| :ref:`🔗` Returns an array with all :ref:`Script` objects which are currently open in editor. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_goto_help: .. rst-class:: classref-method |void| **goto_help**\ (\ topic\: :ref:`String`\ ) :ref:`🔗` Opens help for the given topic. The ``topic`` is an encoded string that controls which class, method, constant, signal, annotation, property, or theme item should be focused. The supported ``topic`` formats include ``class_name:class``, ``class_method:class:method``, ``class_constant:class:constant``, ``class_signal:class:signal``, ``class_annotation:class:@annotation``, ``class_property:class:property``, and ``class_theme_item:class:item``, where ``class`` is the class name, ``method`` is the method name, ``constant`` is the constant name, ``signal`` is the signal name, ``annotation`` is the annotation name, ``property`` is the property name, and ``item`` is the theme item. :: # Shows help for the Node class. class_name:Node # Shows help for the global min function. # Global objects are accessible in the `@GlobalScope` namespace, shown here. class_method:@GlobalScope:min # Shows help for get_viewport in the Node class. class_method:Node:get_viewport # Shows help for the Input constant MOUSE_BUTTON_MIDDLE. class_constant:Input:MOUSE_BUTTON_MIDDLE # Shows help for the BaseButton signal pressed. class_signal:BaseButton:pressed # Shows help for the CanvasItem property visible. class_property:CanvasItem:visible # Shows help for the GDScript annotation export. # Annotations should be prefixed with the `@` symbol in the descriptor, as shown here. class_annotation:@GDScript:@export # Shows help for the GraphNode theme item named panel_selected. class_theme_item:GraphNode:panel_selected .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_goto_line: .. rst-class:: classref-method |void| **goto_line**\ (\ line_number\: :ref:`int`\ ) :ref:`🔗` Goes to the specified line in the current script. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_open_script_create_dialog: .. rst-class:: classref-method |void| **open_script_create_dialog**\ (\ base_name\: :ref:`String`, base_path\: :ref:`String`\ ) :ref:`🔗` Opens the script create dialog. The script will extend ``base_name``. The file extension can be omitted from ``base_path``. It will be added based on the selected scripting language. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_register_syntax_highlighter: .. rst-class:: classref-method |void| **register_syntax_highlighter**\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter`\ ) :ref:`🔗` Registers the :ref:`EditorSyntaxHighlighter` to the editor, the :ref:`EditorSyntaxHighlighter` will be available on all open scripts. \ **Note:** Does not apply to scripts that are already opened. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_unregister_syntax_highlighter: .. rst-class:: classref-method |void| **unregister_syntax_highlighter**\ (\ syntax_highlighter\: :ref:`EditorSyntaxHighlighter`\ ) :ref:`🔗` Unregisters the :ref:`EditorSyntaxHighlighter` from the editor. \ **Note:** The :ref:`EditorSyntaxHighlighter` will still be applied to scripts that are already opened. .. rst-class:: classref-item-separator ---- .. _class_ScriptEditor_method_update_docs_from_script: .. rst-class:: classref-method |void| **update_docs_from_script**\ (\ script\: :ref:`Script`\ ) :ref:`🔗` Updates the documentation for the given ``script`` if the script's documentation is currently open. \ **Note:** This should be called whenever the script is changed to keep the open documentation state up to date. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`