| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ScriptEditor" inherits="PanelContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Godot editor's script editor. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | Godot editor's script editor. |
| 8 | [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_script_editor]. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="clear_docs_from_script"> |
| 14 | <return type="void" /> |
| 15 | <param index="0" name="script" type="Script" /> |
| 16 | <description> |
| 17 | Removes the documentation for the given [param script]. |
| 18 | [b]Note:[/b] This should be called whenever the script is changed to keep the open documentation state up to date. |
| 19 | </description> |
| 20 | </method> |
| 21 | <method name="get_breakpoints"> |
| 22 | <return type="PackedStringArray" /> |
| 23 | <description> |
| 24 | Returns array of breakpoints. |
| 25 | </description> |
| 26 | </method> |
| 27 | <method name="get_current_editor" qualifiers="const"> |
| 28 | <return type="ScriptEditorBase" /> |
| 29 | <description> |
| 30 | Returns the [ScriptEditorBase] object that the user is currently editing. |
| 31 | </description> |
| 32 | </method> |
| 33 | <method name="get_current_script"> |
| 34 | <return type="Script" /> |
| 35 | <description> |
| 36 | Returns a [Script] that is currently active in editor. |
| 37 | </description> |
| 38 | </method> |
| 39 | <method name="get_open_script_editors" qualifiers="const"> |
| 40 | <return type="ScriptEditorBase[]" /> |
| 41 | <description> |
| 42 | Returns an array with all [ScriptEditorBase] objects which are currently open in editor. |
| 43 | </description> |
| 44 | </method> |
| 45 | <method name="get_open_scripts" qualifiers="const"> |
| 46 | <return type="Script[]" /> |
| 47 | <description> |
| 48 | Returns an array with all [Script] objects which are currently open in editor. |
| 49 | </description> |
| 50 | </method> |
| 51 | <method name="goto_help"> |
| 52 | <return type="void" /> |
| 53 | <param index="0" name="topic" type="String" /> |
| 54 | <description> |
| 55 | Opens help for the given topic. The [param topic] is an encoded string that controls which class, method, constant, signal, annotation, property, or theme item should be focused. |
| 56 | The supported [param topic] formats include [code]class_name:class[/code], [code]class_method:class:method[/code], [code]class_constant:class:constant[/code], [code]class_signal:class:signal[/code], [code]class_annotation:class:@annotation[/code], [code]class_property:class:property[/code], and [code]class_theme_item:class:item[/code], where [code]class[/code] is the class name, [code]method[/code] is the method name, [code]constant[/code] is the constant name, [code]signal[/code] is the signal name, [code]annotation[/code] is the annotation name, [code]property[/code] is the property name, and [code]item[/code] is the theme item. |
| 57 | [codeblock] |
| 58 | # Shows help for the Node class. |
| 59 | class_name:Node |
| 60 | # Shows help for the global min function. |
| 61 | # Global objects are accessible in the `@GlobalScope` namespace, shown here. |
| 62 | class_method:@GlobalScope:min |
| 63 | # Shows help for get_viewport in the Node class. |
| 64 | class_method:Node:get_viewport |
| 65 | # Shows help for the Input constant MOUSE_BUTTON_MIDDLE. |
| 66 | class_constant:Input:MOUSE_BUTTON_MIDDLE |
| 67 | # Shows help for the BaseButton signal pressed. |
| 68 | class_signal:BaseButton:pressed |
| 69 | # Shows help for the CanvasItem property visible. |
| 70 | class_property:CanvasItem:visible |
| 71 | # Shows help for the GDScript annotation export. |
| 72 | # Annotations should be prefixed with the `@` symbol in the descriptor, as shown here. |
| 73 | class_annotation:@GDScript:@export |
| 74 | # Shows help for the GraphNode theme item named panel_selected. |
| 75 | class_theme_item:GraphNode:panel_selected |
| 76 | [/codeblock] |
| 77 | </description> |
| 78 | </method> |
| 79 | <method name="goto_line"> |
| 80 | <return type="void" /> |
| 81 | <param index="0" name="line_number" type="int" /> |
| 82 | <description> |
| 83 | Goes to the specified line in the current script. |
| 84 | </description> |
| 85 | </method> |
| 86 | <method name="open_script_create_dialog"> |
| 87 | <return type="void" /> |
| 88 | <param index="0" name="base_name" type="String" /> |
| 89 | <param index="1" name="base_path" type="String" /> |
| 90 | <description> |
| 91 | Opens the script create dialog. The script will extend [param base_name]. The file extension can be omitted from [param base_path]. It will be added based on the selected scripting language. |
| 92 | </description> |
| 93 | </method> |
| 94 | <method name="register_syntax_highlighter"> |
| 95 | <return type="void" /> |
| 96 | <param index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter" /> |
| 97 | <description> |
| 98 | Registers the [EditorSyntaxHighlighter] to the editor, the [EditorSyntaxHighlighter] will be available on all open scripts. |
| 99 | [b]Note:[/b] Does not apply to scripts that are already opened. |
| 100 | </description> |
| 101 | </method> |
| 102 | <method name="unregister_syntax_highlighter"> |
| 103 | <return type="void" /> |
| 104 | <param index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter" /> |
| 105 | <description> |
| 106 | Unregisters the [EditorSyntaxHighlighter] from the editor. |
| 107 | [b]Note:[/b] The [EditorSyntaxHighlighter] will still be applied to scripts that are already opened. |
| 108 | </description> |
| 109 | </method> |
| 110 | <method name="update_docs_from_script"> |
| 111 | <return type="void" /> |
| 112 | <param index="0" name="script" type="Script" /> |
| 113 | <description> |
| 114 | Updates the documentation for the given [param script]. |
| 115 | [b]Note:[/b] This should be called whenever the script is changed to keep the open documentation state up to date. |
| 116 | </description> |
| 117 | </method> |
| 118 | </methods> |
| 119 | <signals> |
| 120 | <signal name="editor_script_changed"> |
| 121 | <param index="0" name="script" type="Script" /> |
| 122 | <description> |
| 123 | Emitted when user changed active script. Argument is a freshly activated [Script]. |
| 124 | </description> |
| 125 | </signal> |
| 126 | <signal name="script_close"> |
| 127 | <param index="0" name="script" type="Script" /> |
| 128 | <description> |
| 129 | Emitted when editor is about to close the active script. Argument is a [Script] that is going to be closed. |
| 130 | </description> |
| 131 | </signal> |
| 132 | </signals> |
| 133 | </class> |