Skip to content

Commit d610bfd

Browse files
committed
GDScript: Document @warning_ignore_start and @warning_ignore_restore
1 parent 5eebe5f commit d610bfd

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

_extensions/gdscript.py

+2
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ def innerstring_rules(ttype):
428428
"@static_unload",
429429
"@tool",
430430
"@warning_ignore",
431+
"@warning_ignore_restore",
432+
"@warning_ignore_start",
431433
),
432434
prefix=r"(?<!\.)",
433435
suffix=r"\b",

tutorials/scripting/gdscript/warning_system.rst

+11-5
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ script editor's status bar. The example below has 2 warnings:
2323

2424
.. image:: img/typed_gdscript_warning_example.webp
2525

26-
To ignore specific warnings in one file, insert an annotation of the
27-
form ``@warning_ignore("warning-id")``, or click on the ignore link to the
28-
left of the warning's description. Godot will add an annotation above the
29-
corresponding line and the code won't trigger the corresponding warning
30-
anymore:
26+
To ignore single warnings within a file, use the
27+
:ref:`@warning_ignore <class_@GDScript_annotation_@warning_ignore>` annotation.
28+
You can click on the ignore link to the left of the warning's description.
29+
Godot will add an annotation above the corresponding line and the code
30+
won't trigger the corresponding warning anymore:
3131

3232
.. image:: img/typed_gdscript_warning_system_ignore.webp
3333

34+
To ignore multiple warnings in a region within a file, use the
35+
:ref:`@warning_ignore_start <class_@GDScript_annotation_@warning_ignore_start>`
36+
and :ref:`@warning_ignore_restore <class_@GDScript_annotation_@warning_ignore_restore>`
37+
annotations. You can omit ``@warning_ignore_restore`` if you want to ignore
38+
the specified warning types until the end of the file.
39+
3440
Warnings won't prevent the game from running, but you can turn them into
3541
errors if you'd like. This way your game won't compile unless you fix
3642
all warnings. Head to the ``GDScript`` section of the Project Settings to

0 commit comments

Comments
 (0)