@abaplint/core 2.113.0 → 2.113.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.
@@ -2679,6 +2679,8 @@ declare class FunctionExportingParameter extends Expression {
2679
2679
  declare class FunctionGroup extends ABAPObject {
2680
2680
  private includes;
2681
2681
  private modules;
2682
+ private description;
2683
+ private dynpros;
2682
2684
  getType(): string;
2683
2685
  getDescription(): string | undefined;
2684
2686
  setDirty(): void;
@@ -2686,6 +2688,7 @@ declare class FunctionGroup extends ABAPObject {
2686
2688
  maxLength: number;
2687
2689
  allowNamespace: boolean;
2688
2690
  };
2691
+ getDynpros(): DynproList;
2689
2692
  getSequencedFiles(): readonly ABAPFile[];
2690
2693
  getModules(): FunctionModuleDefinition[];
2691
2694
  getIncludeFiles(): {
@@ -4901,9 +4904,6 @@ declare namespace Objects {
4901
4904
  Package,
4902
4905
  Parameter,
4903
4906
  PersonalizationObject,
4904
- DynproField,
4905
- DynproHeader,
4906
- DynproList,
4907
4907
  Program,
4908
4908
  ProxyObject,
4909
4909
  PushChannel,
@@ -16,6 +16,8 @@ exports.DECLARATION_STUFF = [
16
16
  Statements.Data,
17
17
  Statements.DataBegin,
18
18
  Statements.Constant,
19
+ Statements.Tables,
20
+ Statements.Include, // this is not super correct, but anyhow
19
21
  Statements.Parameter,
20
22
  Statements.SelectionScreen,
21
23
  Statements.ConstantBegin,
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDynpros = parseDynpros;
4
+ const xml_utils_1 = require("../xml_utils");
5
+ function parseDynpros(parsed) {
6
+ var _a, _b, _c, _d;
7
+ const dynpros = [];
8
+ 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;
9
+ if (xmlDynpros !== undefined) {
10
+ for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
11
+ const fields = [];
12
+ for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
13
+ fields.push({
14
+ name: f.NAME,
15
+ type: f.TYPE,
16
+ length: f.LENGTH,
17
+ });
18
+ }
19
+ dynpros.push({
20
+ number: d.HEADER.SCREEN,
21
+ fields: fields,
22
+ });
23
+ }
24
+ }
25
+ return dynpros;
26
+ }
27
+ //# sourceMappingURL=_dynpros.js.map
@@ -5,18 +5,23 @@ const _abap_object_1 = require("./_abap_object");
5
5
  const types_1 = require("../abap/types");
6
6
  const xml_utils_1 = require("../xml_utils");
7
7
  const fast_xml_parser_1 = require("fast-xml-parser");
8
+ const _dynpros_1 = require("./_dynpros");
8
9
  class FunctionGroup extends _abap_object_1.ABAPObject {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  this.includes = undefined;
12
13
  this.modules = undefined;
14
+ this.description = undefined;
15
+ this.dynpros = undefined;
13
16
  }
14
17
  getType() {
15
18
  return "FUGR";
16
19
  }
17
20
  getDescription() {
18
- // todo
19
- return undefined;
21
+ if (this.description === undefined) {
22
+ this.parseXML();
23
+ }
24
+ return this.description;
20
25
  }
21
26
  setDirty() {
22
27
  super.setDirty();
@@ -29,6 +34,12 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
29
34
  allowNamespace: true,
30
35
  };
31
36
  }
37
+ getDynpros() {
38
+ if (this.dynpros === undefined) {
39
+ this.parseXML();
40
+ }
41
+ return this.dynpros || [];
42
+ }
32
43
  getSequencedFiles() {
33
44
  const main = this.getMainABAPFile();
34
45
  if (main === undefined) {
@@ -130,22 +141,24 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
130
141
  }
131
142
  /////////////////////////////////
132
143
  parseXML() {
133
- var _a, _b;
144
+ var _a, _b, _c;
134
145
  this.includes = [];
135
146
  this.modules = [];
136
147
  const parsed = this.parseRaw2();
137
148
  if (parsed === undefined) {
138
149
  return;
139
150
  }
151
+ this.description = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.AREAT;
152
+ this.dynpros = (0, _dynpros_1.parseDynpros)(parsed);
140
153
  // INCLUDES
141
- const includes = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.INCLUDES;
154
+ const includes = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.INCLUDES;
142
155
  if (includes !== undefined) {
143
156
  for (const i of (0, xml_utils_1.xmlToArray)(includes.SOBJ_NAME)) {
144
157
  this.includes.push(i);
145
158
  }
146
159
  }
147
160
  // FUNCTION MODULES
148
- const functions = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.FUNCTIONS;
161
+ const functions = (_c = parsed.abapGit["asx:abap"]["asx:values"]) === null || _c === void 0 ? void 0 : _c.FUNCTIONS;
149
162
  for (const module of (0, xml_utils_1.xmlToArray)(functions === null || functions === void 0 ? void 0 : functions.item)) {
150
163
  this.modules.push(new types_1.FunctionModuleDefinition(module));
151
164
  }
@@ -2,7 +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
+ const _dynpros_1 = require("./_dynpros");
6
6
  class Program extends _abap_object_1.ABAPObject {
7
7
  getType() {
8
8
  return "PROG";
@@ -38,11 +38,10 @@ class Program extends _abap_object_1.ABAPObject {
38
38
  }
39
39
  getDynpros() {
40
40
  this.parseXML();
41
- return this.parsedXML.dynpros;
41
+ return this.parsedXML.dynpros || [];
42
42
  }
43
43
  ////////////////////////////
44
44
  parseXML() {
45
- var _a, _b, _c, _d;
46
45
  if (this.parsedXML !== undefined) {
47
46
  return;
48
47
  }
@@ -56,24 +55,7 @@ class Program extends _abap_object_1.ABAPObject {
56
55
  };
57
56
  return;
58
57
  }
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
- }
58
+ const dynpros = (0, _dynpros_1.parseDynpros)(parsed);
77
59
  this.parsedXML = {
78
60
  isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
79
61
  isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.0";
70
+ return "2.113.2";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -21,25 +21,25 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
21
21
  title: "Add test attributes for tests classes with test methods",
22
22
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
23
23
  tags: [_irule_1.RuleTag.SingleFile],
24
- badExample: `CLASS ltcl_test DEFINITION FINAL FOR TESTING.
24
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
25
25
  PUBLIC SECTION.
26
26
  PROTECTED SECTION.
27
27
  PRIVATE SECTION.
28
28
  METHODS test FOR TESTING RAISING cx_static_check.
29
29
  ENDCLASS.
30
30
 
31
- CLASS ltcl_test IMPLEMENTATION.
31
+ CLASS ltcl_test1 IMPLEMENTATION.
32
32
  METHOD test.
33
33
  ENDMETHOD.
34
34
  ENDCLASS.`,
35
- goodExample: `CLASS ltcl_test DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
35
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
36
36
  PUBLIC SECTION.
37
37
  PROTECTED SECTION.
38
38
  PRIVATE SECTION.
39
39
  METHODS test FOR TESTING RAISING cx_static_check.
40
40
  ENDCLASS.
41
41
 
42
- CLASS ltcl_test IMPLEMENTATION.
42
+ CLASS ltcl_test2 IMPLEMENTATION.
43
43
  METHOD test.
44
44
  ENDMETHOD.
45
45
  ENDCLASS.`,
@@ -23,12 +23,11 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
23
23
  shortDescription: `Empty selection screen or list processing event block`,
24
24
  extendedInformation: ``,
25
25
  tags: [_irule_1.RuleTag.SingleFile],
26
- badExample: `REPORT zfoo.
27
- START-OF-SELECTION.
28
- PERFORM sdf.
29
- COMMIT WORK.
26
+ badExample: `
27
+ INITIALIZATION.
28
+ WRITE 'hello'.
30
29
  END-OF-SELECTION.`,
31
- goodExample: `REPORT zfoo.
30
+ goodExample: `
32
31
  START-OF-SELECTION.
33
32
  PERFORM sdf.
34
33
  COMMIT WORK.`,
@@ -53,6 +52,9 @@ START-OF-SELECTION.
53
52
  let children = [];
54
53
  for (const s of stru.getChildren() || []) {
55
54
  if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
55
+ if (currentEvent !== undefined && children.length === 0) {
56
+ issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
57
+ }
56
58
  children = [];
57
59
  currentEvent = s;
58
60
  }
@@ -65,7 +67,11 @@ START-OF-SELECTION.
65
67
  children.push(s);
66
68
  }
67
69
  else {
70
+ if (currentEvent !== undefined && children.length === 0) {
71
+ issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
72
+ }
68
73
  children = [];
74
+ currentEvent = undefined;
69
75
  }
70
76
  }
71
77
  if (currentEvent !== undefined && children.length === 0) {
@@ -28,7 +28,7 @@ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selectio
28
28
  tags: [_irule_1.RuleTag.SingleFile],
29
29
  badExample: `REPORT zfoo.
30
30
  WRITE 'hello'.`,
31
- goodExample: `REPORT zfoo.
31
+ goodExample: `
32
32
  START-OF-SELECTION.
33
33
  WRITE 'hello'.`,
34
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.0",
3
+ "version": "2.113.2",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",