From 57618e977560eaf3de1f246931f86d0312afedee Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 4 Dec 2025 00:22:49 +0100 Subject: [PATCH] Mention other ways to run an EditorScript in Running code in the editor This is particularly useful when using an external editor, as the original approach can't be used. --- .../plugins/running_code_in_the_editor.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tutorials/plugins/running_code_in_the_editor.rst b/tutorials/plugins/running_code_in_the_editor.rst index 11a2a9c1838..72e214eee7b 100644 --- a/tutorials/plugins/running_code_in_the_editor.rst +++ b/tutorials/plugins/running_code_in_the_editor.rst @@ -530,14 +530,21 @@ EditorScripts, with a ``_run()`` method already inserted: This ``_run()`` method is executed when you use **File > Run** or the keyboard shortcut :kbd:`Ctrl + Shift + X` while the EditorScript is the currently open script in the script editor. This keyboard shortcut is only effective when -currently focused on the script editor. +currently focused on the script editor. If using an external script editor, then +you must use one of the approaches described below to run the EditorScript. -Scripts that extend EditorScript must be ``@tool`` scripts to function. +There are two other ways to run an EditorScript: -.. note:: +- If the script has a ``class_name`` set at the top, it will appear in the command palette. + Press :kbd:`Ctrl + Shift + P` (:kbd:`Cmd + Shift + P` on macOS) to bring up + the command palette, then enter the class name. The script will appear under + the Editor Scripts category. The class name is automatically capitalized, + which means a class such as ``AddFoliage`` will appear + as :menu:`Add Foliage`. +- Right-click the script in the FileSystem dock and choose the :menu:`Run` option. + This option only appears on scripts that inherit from EditorScript. - EditorScripts can only be run from the Godot script editor. If you are using - an external editor, open the script inside the Godot script editor to run it. +Scripts that extend EditorScript must be ``@tool`` scripts to function. .. danger::