Skip to content

Commit 1e2867c

Browse files
authored
Merge pull request godotengine#8341 from raulsntos/dotnet/diagnostics-update
Update C# diagnostic documentation
2 parents 91369b5 + 52ac488 commit 1e2867c

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

tutorials/scripting/c_sharp/diagnostics/GD0001.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
GD0001: Missing partial modifier on declaration of type which is a subclass of GodotObject
2-
==========================================================================================
1+
GD0001: Missing partial modifier on declaration of type that derives from GodotObject
2+
=====================================================================================
33

44
==================================== ======================================
55
Value

tutorials/scripting/c_sharp/diagnostics/GD0002.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
GD0002: Missing partial modifier on declaration of type which contains one or more subclasses of GodotObject
2-
============================================================================================================
1+
GD0002: Missing partial modifier on declaration of type which contains nested classes that derive from GodotObject
2+
==================================================================================================================
33

44
==================================== ======================================
55
Value
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
GD0107: Types not derived from Node should not export Node members
2+
==================================================================
3+
4+
==================================== ======================================
5+
Value
6+
==================================== ======================================
7+
**Rule ID** GD0107
8+
**Category** Usage
9+
**Fix is breaking or non-breaking** Breaking
10+
**Enabled by default** Yes
11+
==================================== ======================================
12+
13+
Cause
14+
-----
15+
16+
A type that doesn't derive from ``Node`` contains an exported field or property
17+
of a type that derives from ``Node``.
18+
19+
Rule description
20+
----------------
21+
22+
Exported nodes are serialized as ``NodePath``. Only types derived from ``Node``
23+
are able to get the node instance from the ``NodePath``.
24+
25+
How to fix violations
26+
---------------------
27+
28+
To fix a violation of this rule, avoid exporting ``Node`` members on a type that
29+
doesn't derive from ``Node``, or consider exporting a ``NodePath``.
30+
31+
When to suppress warnings
32+
-------------------------
33+
34+
Do not suppress a warning from this rule. Types that don't derive from ``Node``
35+
will be unable to retrieve the right node instance for exported ``Node`` members,
36+
resulting in unexpected runtime errors.

tutorials/scripting/c_sharp/diagnostics/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Rules
1919
GD0104
2020
GD0105
2121
GD0106
22+
GD0107
2223
GD0201
2324
GD0202
2425
GD0203

0 commit comments

Comments
 (0)