@abaplint/core 2.102.50 → 2.102.52
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.
|
@@ -97,20 +97,23 @@ class Select {
|
|
|
97
97
|
if (isDynamic) {
|
|
98
98
|
throw new Error(`dynamic field list, inlining not possible`);
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
let type = new basic_1.VoidType("SELECT_todo");
|
|
101
|
+
if (isSimple.test(field.code)) {
|
|
102
|
+
for (const dbSource of dbSources) {
|
|
103
|
+
if (dbSource === undefined) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const dbType = dbSource.parseType(scope.getRegistry());
|
|
107
|
+
if (dbType instanceof basic_1.StructureType) {
|
|
108
|
+
const found = dbType.getComponentByName(field.code);
|
|
109
|
+
if (found) {
|
|
110
|
+
type = found;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
107
113
|
}
|
|
108
114
|
}
|
|
109
|
-
new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("SELECT_todo"));
|
|
113
115
|
}
|
|
116
|
+
new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
119
|
}
|
|
@@ -19,7 +19,8 @@ class Message {
|
|
|
19
19
|
return this.message;
|
|
20
20
|
}
|
|
21
21
|
getPlaceholderCount() {
|
|
22
|
-
|
|
22
|
+
const escaped = (this.getMessage().match(/&&/g) || []).length;
|
|
23
|
+
return (this.getMessage().match(/&/g) || []).length - escaped * 2;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
exports.Message = Message;
|
package/build/src/registry.js
CHANGED
|
@@ -2384,6 +2384,9 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
2384
2384
|
else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {
|
|
2385
2385
|
continue;
|
|
2386
2386
|
}
|
|
2387
|
+
else if (found.getType() instanceof basic_1.StructureType && found.getType().getQualifiedName() === undefined) {
|
|
2388
|
+
continue;
|
|
2389
|
+
}
|
|
2387
2390
|
let type = found.getType().getQualifiedName()
|
|
2388
2391
|
? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
|
|
2389
2392
|
: found.getType().toABAP();
|
|
@@ -6,6 +6,11 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
|
6
6
|
const objects_1 = require("../objects");
|
|
7
7
|
const position_1 = require("../position");
|
|
8
8
|
class MSAGConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/** paramters must be numbered */
|
|
12
|
+
this.numericParamters = true;
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
exports.MSAGConsistencyConf = MSAGConsistencyConf;
|
|
11
16
|
class MSAGConsistency {
|
|
@@ -39,7 +44,7 @@ class MSAGConsistency {
|
|
|
39
44
|
}
|
|
40
45
|
const numbers = new Set();
|
|
41
46
|
for (const message of obj.getMessages()) {
|
|
42
|
-
// todo, get the right positions in xml file
|
|
47
|
+
// todo, get the right positions in xml file, and report the issue there
|
|
43
48
|
if (!message.getNumber().match(/\d\d\d/)) {
|
|
44
49
|
const text = this.getDescription("Message number must be 3 digits: message " + message.getNumber());
|
|
45
50
|
const position = new position_1.Position(1, 1);
|
|
@@ -62,6 +67,25 @@ class MSAGConsistency {
|
|
|
62
67
|
else {
|
|
63
68
|
numbers.add(num);
|
|
64
69
|
}
|
|
70
|
+
if (this.getConfig().numericParamters === true) {
|
|
71
|
+
const placeholderCount = message.getPlaceholderCount();
|
|
72
|
+
if (placeholderCount > 4) {
|
|
73
|
+
const text = `More than 4 placeholders in mesasge ${message.getNumber()}`;
|
|
74
|
+
const position = new position_1.Position(1, 1);
|
|
75
|
+
const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
|
|
76
|
+
issues.push(issue);
|
|
77
|
+
}
|
|
78
|
+
for (let i = 1; i <= placeholderCount; i++) {
|
|
79
|
+
const placeholder = "&" + i;
|
|
80
|
+
if (message.getMessage().includes(placeholder) === false) {
|
|
81
|
+
const text = `Expected placeholder ${placeholder} in message ${message.getNumber()}`;
|
|
82
|
+
const position = new position_1.Position(1, 1);
|
|
83
|
+
const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
|
|
84
|
+
issues.push(issue);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
65
89
|
}
|
|
66
90
|
return issues;
|
|
67
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.52",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.
|
|
53
|
+
"@microsoft/api-extractor": "^7.38.0",
|
|
54
54
|
"@types/chai": "^4.3.6",
|
|
55
55
|
"@types/mocha": "^10.0.2",
|
|
56
|
-
"@types/node": "^20.
|
|
57
|
-
"chai": "^4.3.
|
|
56
|
+
"@types/node": "^20.8.0",
|
|
57
|
+
"chai": "^4.3.10",
|
|
58
58
|
"eslint": "^8.50.0",
|
|
59
59
|
"mocha": "^10.2.0",
|
|
60
60
|
"c8": "^8.0.1",
|