Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions tutorials/plugins/running_code_in_the_editor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automatic capitalization is a bit confusing as the capitalization of the example doesn't change, a space is inserted though, I think this can be clarified further (and make it clear what happens for a class like add_foliage

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::

Expand Down