@abaplint/core 2.92.2 → 2.93.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abaplint.d.ts +16 -0
- package/build/src/abap/5_syntax/expressions/field_chain.js +4 -1
- package/build/src/abap/nodes/structure_node.js +24 -0
- package/build/src/cds/cds_lexer.js +27 -18
- package/build/src/cds/cds_parser.js +6 -1
- package/build/src/cds/expressions/cds_annotate.js +12 -0
- package/build/src/cds/expressions/index.js +1 -0
- package/build/src/objects/cds_metadata_extension.js +27 -0
- package/build/src/objects/data_definition.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/begin_end_names.js +4 -4
- package/build/src/rules/cds_comment_style.js +60 -0
- package/build/src/rules/cds_legacy_view.js +1 -1
- package/build/src/rules/cds_parser_error.js +7 -6
- package/build/src/rules/change_if_to_case.js +125 -0
- package/build/src/rules/constant_classes.js +1 -1
- package/build/src/rules/definitions_top.js +26 -24
- package/build/src/rules/downport.js +184 -111
- package/build/src/rules/index.js +6 -4
- package/package.json +2 -2
|
@@ -56,16 +56,15 @@ https://docs.abapopenchecks.org/checks/17/`,
|
|
|
56
56
|
if (containsUnknown === true) {
|
|
57
57
|
return [];
|
|
58
58
|
}
|
|
59
|
-
const routines = structure.
|
|
59
|
+
const routines = structure.findAllStructuresMulti([Structures.Form, Structures.Method]);
|
|
60
60
|
for (const r of routines) {
|
|
61
61
|
// one fix per routine
|
|
62
62
|
this.fixed = false;
|
|
63
63
|
this.mode = DEFINITION;
|
|
64
64
|
this.moveTo = (_a = r.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.getLastToken().getEnd();
|
|
65
|
-
if (this.reg.getConfig().getVersion() !== version_1.Version.v702
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
65
|
+
if (this.reg.getConfig().getVersion() !== version_1.Version.v702
|
|
66
|
+
&& r.findFirstExpression(Expressions.InlineData)) {
|
|
67
|
+
continue;
|
|
69
68
|
}
|
|
70
69
|
const found = this.walk(r, file);
|
|
71
70
|
if (found) {
|
|
@@ -79,20 +78,23 @@ https://docs.abapopenchecks.org/checks/17/`,
|
|
|
79
78
|
var _a, _b, _c, _d, _e, _f;
|
|
80
79
|
let previous = undefined;
|
|
81
80
|
for (const c of r.getChildren()) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
const get = c.get();
|
|
82
|
+
if (c instanceof nodes_1.StatementNode) {
|
|
83
|
+
if (get instanceof _statement_1.Comment) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
else if (get instanceof Statements.Form) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
else if (get instanceof Statements.MethodImplementation) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
90
92
|
}
|
|
91
93
|
if (c instanceof nodes_1.StructureNode
|
|
92
|
-
&& (
|
|
93
|
-
||
|
|
94
|
-
||
|
|
95
|
-
||
|
|
94
|
+
&& (get instanceof Structures.Data
|
|
95
|
+
|| get instanceof Structures.Types
|
|
96
|
+
|| get instanceof Structures.Constants
|
|
97
|
+
|| get instanceof Structures.Statics)) {
|
|
96
98
|
if (this.mode === AFTER) {
|
|
97
99
|
// These are chained structured statements
|
|
98
100
|
let fix = undefined;
|
|
@@ -118,11 +120,11 @@ https://docs.abapopenchecks.org/checks/17/`,
|
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
else if (c instanceof nodes_1.StatementNode
|
|
121
|
-
&& (
|
|
122
|
-
||
|
|
123
|
-
||
|
|
124
|
-
||
|
|
125
|
-
||
|
|
123
|
+
&& (get instanceof Statements.Data
|
|
124
|
+
|| get instanceof Statements.Type
|
|
125
|
+
|| get instanceof Statements.Constant
|
|
126
|
+
|| get instanceof Statements.Static
|
|
127
|
+
|| get instanceof Statements.FieldSymbol)) {
|
|
126
128
|
if (this.mode === AFTER) {
|
|
127
129
|
// only one fix per routine, as it reorders a lot
|
|
128
130
|
let fix = undefined;
|
|
@@ -136,11 +138,11 @@ https://docs.abapopenchecks.org/checks/17/`,
|
|
|
136
138
|
this.moveTo = c.getLastToken().getEnd();
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
|
-
else if (c instanceof nodes_1.StructureNode &&
|
|
141
|
+
else if (c instanceof nodes_1.StructureNode && get instanceof Structures.Define) {
|
|
140
142
|
this.mode = IGNORE;
|
|
141
143
|
return undefined;
|
|
142
144
|
}
|
|
143
|
-
else if (c instanceof nodes_1.StatementNode &&
|
|
145
|
+
else if (c instanceof nodes_1.StatementNode && get instanceof _statement_1.Unknown) {
|
|
144
146
|
this.mode = IGNORE;
|
|
145
147
|
return undefined;
|
|
146
148
|
}
|