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: content/docs/analyzers/FormattingCop/FC0002.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,65 @@ codeunit 50100 MyCodeunit
41
41
}
42
42
```
43
43
44
+
### Generic type arguments
45
+
46
+
FC0002 checks the casing of types used as generic type arguments inside `List of [...]`, `Dictionary of [...]`, and other generic type declarations. Both built-in type keywords and subtype keywords are checked:
47
+
48
+
```al
49
+
codeunit 50100 MyCodeunit
50
+
{
51
+
var
52
+
Names: List of [TEXT]; // Casing mismatch: TEXT should be Text [FC0002]
53
+
Lookup: Dictionary of [INTEGER, TEXT]; // Two casing mismatches [FC0002]
54
+
Nested: List of [Dictionary of [Integer, TEXT]]; // [FC0002]
55
+
}
56
+
```
57
+
58
+
### Object reference casing
59
+
60
+
FC0002 checks the casing of object names referenced in `Record`, `Codeunit`, `Interface`, `Page`, `XmlPort`, and other subtyped data type declarations. The object name must match the casing of the original declaration:
61
+
62
+
```al
63
+
codeunit 50100 MyCodeunit
64
+
{
65
+
var
66
+
Cust: Record "MY CUSTOMER"; // Casing mismatch [FC0002]
This applies to global variables, local variables, parameters, and return values. Namespace-qualified references are also checked, including the casing of each namespace part:
82
+
83
+
```al
84
+
namespace MyPublisher.MyExtension.MyAppDomain;
85
+
86
+
codeunit 50100 MyCodeunit
87
+
{
88
+
var
89
+
Cust: Record MYPUBLISHER.MYEXTENSION.MYAPPDOMAIN.MYTABLE; // Four casing mismatches [FC0002]
90
+
}
91
+
92
+
table 50100 MyTable
93
+
{
94
+
fields
95
+
{
96
+
field(1; "Primary Key"; Integer) { }
97
+
}
98
+
}
99
+
```
100
+
101
+
Object references by numeric ID (`Record 50100`) are not checked.
102
+
44
103
### XmlPort vs Xmlport casing
45
104
46
105
The AL language intentionally uses different canonical casings for xmlports depending on the context. FC0002 follows the compiler's own canonical names (the same names the AL Language extension's IntelliSense suggests) rather than enforcing a single spelling:
0 commit comments