@abaplint/core 2.116.1 → 2.117.0
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
CHANGED
|
@@ -42,6 +42,10 @@ class Program extends _abap_object_1.ABAPObject {
|
|
|
42
42
|
this.parseXML();
|
|
43
43
|
return this.parsedXML.dynpros || [];
|
|
44
44
|
}
|
|
45
|
+
getSelectionTexts() {
|
|
46
|
+
this.parseXML();
|
|
47
|
+
return this.parsedXML.selectionTexts;
|
|
48
|
+
}
|
|
45
49
|
////////////////////////////
|
|
46
50
|
parseXML() {
|
|
47
51
|
var _a, _b, _c;
|
|
@@ -56,14 +60,19 @@ class Program extends _abap_object_1.ABAPObject {
|
|
|
56
60
|
isModulePool: false,
|
|
57
61
|
description: undefined,
|
|
58
62
|
dynpros: [],
|
|
63
|
+
selectionTexts: {},
|
|
59
64
|
};
|
|
60
65
|
return;
|
|
61
66
|
}
|
|
62
67
|
let description = "";
|
|
68
|
+
const selectionTexts = {};
|
|
63
69
|
for (const t of (0, xml_utils_1.xmlToArray)((_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.TPOOL) === null || _c === void 0 ? void 0 : _c.item)) {
|
|
64
70
|
if ((t === null || t === void 0 ? void 0 : t.ID) === "R") {
|
|
65
71
|
description = t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "";
|
|
66
72
|
}
|
|
73
|
+
else if ((t === null || t === void 0 ? void 0 : t.ID) === "S" && t.KEY !== undefined) {
|
|
74
|
+
selectionTexts[t.KEY.toUpperCase()] = t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "";
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
77
|
const dynpros = (0, _dynpros_1.parseDynpros)(parsed);
|
|
69
78
|
this.parsedXML = {
|
|
@@ -71,6 +80,7 @@ class Program extends _abap_object_1.ABAPObject {
|
|
|
71
80
|
isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
|
|
72
81
|
dynpros: dynpros,
|
|
73
82
|
description: description,
|
|
83
|
+
selectionTexts: selectionTexts,
|
|
74
84
|
};
|
|
75
85
|
}
|
|
76
86
|
}
|
package/build/src/registry.js
CHANGED
package/build/src/rules/index.js
CHANGED
|
@@ -152,6 +152,7 @@ __exportStar(require("./select_add_order_by"), exports);
|
|
|
152
152
|
__exportStar(require("./select_performance"), exports);
|
|
153
153
|
__exportStar(require("./select_single_full_key"), exports);
|
|
154
154
|
__exportStar(require("./selection_screen_naming"), exports);
|
|
155
|
+
__exportStar(require("./selection_screen_texts_missing"), exports);
|
|
155
156
|
__exportStar(require("./sequential_blank"), exports);
|
|
156
157
|
__exportStar(require("./short_case"), exports);
|
|
157
158
|
__exportStar(require("./sicf_consistency"), exports);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectionScreenTextsMissing = exports.SelectionScreenTextsMissingConf = void 0;
|
|
4
|
+
const issue_1 = require("../issue");
|
|
5
|
+
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
6
|
+
const statements_1 = require("../abap/2_statements/statements");
|
|
7
|
+
const expressions_1 = require("../abap/2_statements/expressions");
|
|
8
|
+
const objects_1 = require("../objects");
|
|
9
|
+
class SelectionScreenTextsMissingConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
|
+
}
|
|
11
|
+
exports.SelectionScreenTextsMissingConf = SelectionScreenTextsMissingConf;
|
|
12
|
+
class SelectionScreenTextsMissing {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.conf = new SelectionScreenTextsMissingConf();
|
|
15
|
+
}
|
|
16
|
+
getMetadata() {
|
|
17
|
+
return {
|
|
18
|
+
key: "selection_screen_texts_missing",
|
|
19
|
+
title: "Selection screen texts missing",
|
|
20
|
+
shortDescription: `Checks that selection screen parameters and select-options have selection texts`,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
getConfig() {
|
|
24
|
+
return this.conf;
|
|
25
|
+
}
|
|
26
|
+
setConfig(conf) {
|
|
27
|
+
this.conf = conf;
|
|
28
|
+
}
|
|
29
|
+
initialize(reg) {
|
|
30
|
+
this.reg = reg;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
run(obj) {
|
|
34
|
+
if (!(obj instanceof objects_1.Program)) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
if (obj.isInclude()) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const selTexts = obj.getSelectionTexts();
|
|
41
|
+
const output = [];
|
|
42
|
+
const checked = new Set();
|
|
43
|
+
this.checkFile(obj.getMainABAPFile(), selTexts, output, checked);
|
|
44
|
+
return output;
|
|
45
|
+
}
|
|
46
|
+
checkFile(file, selTexts, output, checked) {
|
|
47
|
+
if (file === undefined) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (checked.has(file.getFilename())) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
checked.add(file.getFilename());
|
|
54
|
+
for (const stat of file.getStatements()) {
|
|
55
|
+
const s = stat.get();
|
|
56
|
+
if (s instanceof statements_1.Parameter || s instanceof statements_1.SelectOption) {
|
|
57
|
+
const fieldNode = stat.findFirstExpression(expressions_1.FieldSub);
|
|
58
|
+
if (fieldNode) {
|
|
59
|
+
const fieldName = fieldNode.getFirstToken().getStr().toUpperCase();
|
|
60
|
+
if (selTexts[fieldName] === undefined) {
|
|
61
|
+
output.push(issue_1.Issue.atToken(file, fieldNode.getFirstToken(), `Selection text missing for "${fieldName}"`, this.getMetadata().key, this.conf.severity));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (s instanceof statements_1.Include) {
|
|
66
|
+
const nameNode = stat.findFirstExpression(expressions_1.IncludeName);
|
|
67
|
+
if (nameNode) {
|
|
68
|
+
const inclName = nameNode.getFirstToken().getStr().toUpperCase();
|
|
69
|
+
const inclObj = this.reg.getObject("PROG", inclName);
|
|
70
|
+
if (inclObj) {
|
|
71
|
+
this.checkFile(inclObj.getMainABAPFile(), selTexts, output, checked);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.SelectionScreenTextsMissing = SelectionScreenTextsMissing;
|
|
79
|
+
//# sourceMappingURL=selection_screen_texts_missing.js.map
|