@abaplint/core 2.102.69 → 2.103.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.
@@ -1719,6 +1719,19 @@ declare class Dynamic extends Expression {
1719
1719
  getRunnable(): IStatementRunnable;
1720
1720
  }
1721
1721
 
1722
+ declare type DynproField = {
1723
+ name: string;
1724
+ type: string;
1725
+ length: number;
1726
+ };
1727
+
1728
+ declare type DynproHeader = {
1729
+ number: string;
1730
+ fields: DynproField[];
1731
+ };
1732
+
1733
+ declare type DynproList = DynproHeader[];
1734
+
1722
1735
  declare class EcattTestConfiguration extends AbstractObject {
1723
1736
  getType(): string;
1724
1737
  getAllowedNaming(): {
@@ -4423,6 +4436,9 @@ declare namespace Objects {
4423
4436
  Package,
4424
4437
  Parameter,
4425
4438
  PersonalizationObject,
4439
+ DynproField,
4440
+ DynproHeader,
4441
+ DynproList,
4426
4442
  Program,
4427
4443
  ProxyObject,
4428
4444
  PushChannel,
@@ -4728,7 +4744,8 @@ declare class Program extends ABAPObject {
4728
4744
  setDirty(): void;
4729
4745
  isInclude(): boolean;
4730
4746
  isModulePool(): boolean;
4731
- parseXML(): void;
4747
+ getDynpros(): DynproList;
4748
+ private parseXML;
4732
4749
  }
4733
4750
 
4734
4751
  declare class Program_2 implements IStatement {
@@ -115,11 +115,14 @@ class ClassDefinition extends _identifier_1.Identifier {
115
115
  }
116
116
  names.add(m.getName().toUpperCase());
117
117
  }
118
+ for (const a of (cdef === null || cdef === void 0 ? void 0 : cdef.getAliases().getAll()) || []) {
119
+ names.add(a.getName().toUpperCase());
120
+ }
118
121
  sup = cdef === null || cdef === void 0 ? void 0 : cdef.getSuperClass();
119
122
  }
120
123
  for (const m of this.getMethodDefinitions().getAll()) {
121
124
  if (names.has(m.getName().toUpperCase()) && m.isRedefinition() === false) {
122
- throw new Error(`Method ${m.getName().toUpperCase()} already declared in superclass`);
125
+ throw new Error(`${m.getName().toUpperCase()} already declared in superclass`);
123
126
  }
124
127
  }
125
128
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Program = void 0;
4
4
  const _abap_object_1 = require("./_abap_object");
5
+ const xml_utils_1 = require("../xml_utils");
5
6
  class Program extends _abap_object_1.ABAPObject {
6
7
  getType() {
7
8
  return "PROG";
@@ -35,14 +36,49 @@ class Program extends _abap_object_1.ABAPObject {
35
36
  this.parseXML();
36
37
  return this.parsedXML.isModulePool;
37
38
  }
39
+ getDynpros() {
40
+ this.parseXML();
41
+ return this.parsedXML.dynpros;
42
+ }
43
+ ////////////////////////////
38
44
  parseXML() {
39
- if (this.parsedXML === undefined) {
40
- const file = this.getXMLFile();
45
+ var _a, _b, _c, _d;
46
+ if (this.parsedXML !== undefined) {
47
+ return;
48
+ }
49
+ const file = this.getXMLFile();
50
+ const parsed = this.parseRaw2();
51
+ if (parsed === undefined) {
41
52
  this.parsedXML = {
42
- isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
43
- isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
53
+ isInclude: false,
54
+ isModulePool: false,
55
+ dynpros: [],
44
56
  };
57
+ return;
45
58
  }
59
+ const dynpros = [];
60
+ const xmlDynpros = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DYNPROS;
61
+ if (xmlDynpros !== undefined) {
62
+ for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
63
+ const fields = [];
64
+ for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
65
+ fields.push({
66
+ name: f.NAME,
67
+ type: f.TYPE,
68
+ length: f.LENGTH,
69
+ });
70
+ }
71
+ dynpros.push({
72
+ number: d.HEADER.SCREEN,
73
+ fields: fields,
74
+ });
75
+ }
76
+ }
77
+ this.parsedXML = {
78
+ isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
79
+ isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
80
+ dynpros: dynpros,
81
+ };
46
82
  }
47
83
  }
48
84
  exports.Program = Program;
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.69";
68
+ return "2.103.0";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynproChecks = exports.DynproChecksConf = void 0;
4
+ const issue_1 = require("../issue");
5
+ const _irule_1 = require("./_irule");
6
+ const _basic_rule_config_1 = require("./_basic_rule_config");
7
+ const objects_1 = require("../objects");
8
+ const position_1 = require("../position");
9
+ class DynproChecksConf extends _basic_rule_config_1.BasicRuleConfig {
10
+ }
11
+ exports.DynproChecksConf = DynproChecksConf;
12
+ class DynproChecks {
13
+ constructor() {
14
+ this.conf = new DynproChecksConf();
15
+ }
16
+ getMetadata() {
17
+ return {
18
+ key: "dynpro_checks",
19
+ title: "Dynpro Checks",
20
+ shortDescription: `Various Dynpro checks`,
21
+ extendedInformation: `* Check length of PUSH elements less than 132`,
22
+ tags: [_irule_1.RuleTag.Syntax],
23
+ };
24
+ }
25
+ initialize(_reg) {
26
+ return this;
27
+ }
28
+ getConfig() {
29
+ return this.conf;
30
+ }
31
+ setConfig(conf) {
32
+ this.conf = conf;
33
+ }
34
+ run(obj) {
35
+ const ret = [];
36
+ if (!(obj instanceof objects_1.Program)) {
37
+ return [];
38
+ }
39
+ const file = obj.getXMLFile();
40
+ if (file === undefined) {
41
+ return [];
42
+ }
43
+ for (const dynpro of obj.getDynpros()) {
44
+ for (const field of dynpro.fields) {
45
+ if (field.type === "PUSH" && field.length > 132) {
46
+ const message = `Screen ${dynpro.number}, field ${field.name} LENGTH longer than 132`;
47
+ ret.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.getConfig().severity));
48
+ }
49
+ }
50
+ }
51
+ return ret;
52
+ }
53
+ }
54
+ exports.DynproChecks = DynproChecks;
55
+ //# sourceMappingURL=dynpro_checks.js.map
@@ -53,6 +53,7 @@ __exportStar(require("./definitions_top"), exports);
53
53
  __exportStar(require("./description_empty"), exports);
54
54
  __exportStar(require("./double_space"), exports);
55
55
  __exportStar(require("./downport"), exports);
56
+ __exportStar(require("./dynpro_checks"), exports);
56
57
  __exportStar(require("./easy_to_find_messages"), exports);
57
58
  __exportStar(require("./empty_line_in_statement"), exports);
58
59
  __exportStar(require("./empty_statement"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.69",
3
+ "version": "2.103.0",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",