You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: classes/class_@gdscript.rst
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -787,7 +787,7 @@ Add a custom icon to the current script. The icon specified at ``icon_path`` is
787
787
788
788
\ **Note:** As annotations describe their subject, the :ref:`@icon<class_@GDScript_annotation_@icon>` annotation must be placed before the class definition and inheritance.
789
789
790
-
\ **Note:** Unlike other annotations, the argument of the :ref:`@icon<class_@GDScript_annotation_@icon>` annotation must be a string literal (constant expressions are not supported).
790
+
\ **Note:** Unlike most other annotations, the argument of the :ref:`@icon<class_@GDScript_annotation_@icon>` annotation must be a string literal (constant expressions are not supported).
791
791
792
792
.. rst-class:: classref-item-separator
793
793
@@ -803,7 +803,7 @@ Mark the following property as assigned when the :ref:`Node<class_Node>` is read
803
803
804
804
::
805
805
806
-
@onready var character_name: Label = $Label
806
+
@onready var character_name = $Label
807
807
808
808
.. rst-class:: classref-item-separator
809
809
@@ -893,6 +893,48 @@ Mark the following statement to ignore the specified ``warning``. See :doc:`GDSc
893
893
@warning_ignore("unreachable_code")
894
894
print("unreachable")
895
895
896
+
See also :ref:`@warning_ignore_start<class_@GDScript_annotation_@warning_ignore_start>` and :ref:`@warning_ignore_restore<class_@GDScript_annotation_@warning_ignore_restore>`.
Stops ignoring the listed warning types after :ref:`@warning_ignore_start<class_@GDScript_annotation_@warning_ignore_start>`. Ignoring the specified warning types will be reset to Project Settings. This annotation can be omitted to ignore the warning types until the end of the file.
909
+
910
+
\ **Note:** Unlike most other annotations, arguments of the :ref:`@warning_ignore_restore<class_@GDScript_annotation_@warning_ignore_restore>` annotation must be string literals (constant expressions are not supported).
Starts ignoring the listed warning types until the end of the file or the :ref:`@warning_ignore_restore<class_@GDScript_annotation_@warning_ignore_restore>` annotation with the given warning type.
923
+
924
+
::
925
+
926
+
func test():
927
+
var a = 1 # Warning (if enabled in the Project Settings).
928
+
@warning_ignore_start("unused_variable")
929
+
var b = 2 # No warning.
930
+
var c = 3 # No warning.
931
+
@warning_ignore_restore("unused_variable")
932
+
var d = 4 # Warning (if enabled in the Project Settings).
933
+
934
+
\ **Note:** To suppress a single warning, use :ref:`@warning_ignore<class_@GDScript_annotation_@warning_ignore>` instead.
935
+
936
+
\ **Note:** Unlike most other annotations, arguments of the :ref:`@warning_ignore_start<class_@GDScript_annotation_@warning_ignore_start>` annotation must be string literals (constant expressions are not supported).
0 commit comments