Skip to content

Commit 6e1144a

Browse files
authored
Merge pull request #10504 from Calinou/gdscript-style-guide-icon
Add `@icon` ordering to the GDScript style guide
2 parents 976238c + 265397c commit 6e1144a

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

contributing/development/core_and_modules/common_engine_methods_and_macros.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ repetition:
182182
It's recommended to use ``GLOBAL_DEF``/``EDITOR_DEF`` only once per setting and
183183
use ``GLOBAL_GET``/``EDITOR_GET`` in all other places where it's referenced.
184184

185+
.. _doc_common_engine_methods_and_macros_error_macros:
186+
185187
Error macros
186188
------------
187189

tutorials/scripting/gdscript/gdscript_styleguide.rst

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -764,25 +764,26 @@ We suggest to organize GDScript code this way:
764764
::
765765

766766
01. @tool
767-
02. class_name
768-
03. extends
769-
04. ## docstring
770-
771-
05. signals
772-
06. enums
773-
07. constants
774-
08. @export variables
775-
09. public variables
776-
10. private variables
777-
11. @onready variables
778-
779-
12. optional built-in virtual _init method
780-
13. optional built-in virtual _enter_tree() method
781-
14. built-in virtual _ready method
782-
15. remaining built-in virtual methods
783-
16. public methods
784-
17. private methods
785-
18. subclasses
767+
02. @icon
768+
03. class_name
769+
04. extends
770+
05. ## docstring
771+
772+
06. signals
773+
07. enums
774+
08. constants
775+
09. @export variables
776+
10. public variables
777+
11. private variables
778+
12. @onready variables
779+
780+
13. optional built-in virtual _init method
781+
14. optional built-in virtual _enter_tree() method
782+
15. built-in virtual _ready method
783+
16. remaining built-in virtual methods
784+
17. public methods
785+
18. private methods
786+
19. subclasses
786787

787788
We optimized the order to make it easy to read the code from top to bottom, to
788789
help developers reading the code for the first time understand how it works, and
@@ -803,9 +804,9 @@ Class declaration
803804
If the code is meant to run in the editor, place the ``@tool`` annotation on the
804805
first line of the script.
805806

806-
Follow with the ``class_name`` if necessary. You can turn a GDScript file into a
807-
global type in your project using this feature. For more information, see
808-
:ref:`doc_gdscript`.
807+
Follow with the optional ``@icon`` then the ``class_name`` if necessary. You can turn a
808+
GDScript file into a global type in your project using ``class_name``. For more
809+
information, see :ref:`doc_gdscript`.
809810

810811
Then, add the ``extends`` keyword if the class extends a built-in type.
811812

0 commit comments

Comments
 (0)