@abaplint/core 2.93.0 → 2.93.1
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/src/registry.js
CHANGED
|
@@ -21,6 +21,8 @@ class CDSCommentStyle {
|
|
|
21
21
|
shortDescription: `Check for obsolete comment style`,
|
|
22
22
|
extendedInformation: `Check for obsolete comment style
|
|
23
23
|
|
|
24
|
+
Comments starting with "--" are considered obsolete
|
|
25
|
+
|
|
24
26
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
25
27
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
26
28
|
badExample: "-- this is a comment",
|
|
@@ -24,7 +24,7 @@ class CDSLegacyView {
|
|
|
24
24
|
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
25
25
|
|
|
26
26
|
v755 and up`,
|
|
27
|
-
tags: [_irule_1.RuleTag.SingleFile],
|
|
27
|
+
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
getConfig() {
|
|
@@ -83,10 +83,19 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
83
83
|
const version = this.lowReg.getConfig().getVersion();
|
|
84
84
|
if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {
|
|
85
85
|
this.initHighReg();
|
|
86
|
-
this.graph = new include_graph_1.IncludeGraph(reg);
|
|
87
86
|
}
|
|
88
87
|
return this;
|
|
89
88
|
}
|
|
89
|
+
listMainForInclude(filename) {
|
|
90
|
+
if (filename === undefined) {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
// only initialize this.graph if needed
|
|
94
|
+
if (this.graph === undefined) {
|
|
95
|
+
this.graph = new include_graph_1.IncludeGraph(this.lowReg);
|
|
96
|
+
}
|
|
97
|
+
return this.graph.listMainForInclude(filename);
|
|
98
|
+
}
|
|
90
99
|
run(lowObj) {
|
|
91
100
|
var _a;
|
|
92
101
|
const ret = [];
|
|
@@ -105,7 +114,7 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
105
114
|
let highSyntaxObj = highObj;
|
|
106
115
|
// for includes do the syntax check via a main program
|
|
107
116
|
if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {
|
|
108
|
-
const mains = this.
|
|
117
|
+
const mains = this.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());
|
|
109
118
|
if (mains.length <= 0) {
|
|
110
119
|
return [];
|
|
111
120
|
}
|
|
@@ -115,8 +124,8 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
115
124
|
}
|
|
116
125
|
highSyntaxObj = this.highReg.findObjectForFile(f);
|
|
117
126
|
}
|
|
118
|
-
const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();
|
|
119
127
|
for (const lowFile of lowObj.getABAPFiles()) {
|
|
128
|
+
let highSyntax = undefined;
|
|
120
129
|
const highFile = highObj.getABAPFileByName(lowFile.getFilename());
|
|
121
130
|
if (highFile === undefined) {
|
|
122
131
|
continue;
|
|
@@ -137,6 +146,9 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
137
146
|
const high = highStatements[i];
|
|
138
147
|
if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))
|
|
139
148
|
|| high.findFirstExpression(Expressions.InlineData)) {
|
|
149
|
+
if (highSyntax === undefined) {
|
|
150
|
+
highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();
|
|
151
|
+
}
|
|
140
152
|
const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);
|
|
141
153
|
if (issue) {
|
|
142
154
|
ret.push(issue);
|