Skip to content

Commit 57618e9

Browse files
committed
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.
1 parent 0fce3e7 commit 57618e9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tutorials/plugins/running_code_in_the_editor.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,21 @@ EditorScripts, with a ``_run()`` method already inserted:
530530
This ``_run()`` method is executed when you use **File > Run** or the keyboard
531531
shortcut :kbd:`Ctrl + Shift + X` while the EditorScript is the currently open
532532
script in the script editor. This keyboard shortcut is only effective when
533-
currently focused on the script editor.
533+
currently focused on the script editor. If using an external script editor, then
534+
you must use one of the approaches described below to run the EditorScript.
534535

535-
Scripts that extend EditorScript must be ``@tool`` scripts to function.
536+
There are two other ways to run an EditorScript:
536537

537-
.. note::
538+
- If the script has a ``class_name`` set at the top, it will appear in the command palette.
539+
Press :kbd:`Ctrl + Shift + P` (:kbd:`Cmd + Shift + P` on macOS) to bring up
540+
the command palette, then enter the class name. The script will appear under
541+
the Editor Scripts category. The class name is automatically capitalized,
542+
which means a class such as ``AddFoliage`` will appear
543+
as :menu:`Add Foliage`.
544+
- Right-click the script in the FileSystem dock and choose the :menu:`Run` option.
545+
This option only appears on scripts that inherit from EditorScript.
538546

539-
EditorScripts can only be run from the Godot script editor. If you are using
540-
an external editor, open the script inside the Godot script editor to run it.
547+
Scripts that extend EditorScript must be ``@tool`` scripts to function.
541548

542549
.. danger::
543550

0 commit comments

Comments
 (0)