@abaplint/core 2.113.149 → 2.113.151

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.
@@ -609,6 +609,8 @@ declare class BuiltInMethod extends Identifier implements IMethodDefinition, IMe
609
609
  getRequiredParameters(): readonly TypedIdentifier[];
610
610
  getOptional(): readonly string[];
611
611
  getAll(): readonly TypedIdentifier[];
612
+ getEventName(): undefined;
613
+ getEventClass(): undefined;
612
614
  getImporting(): readonly TypedIdentifier[];
613
615
  getDefaultImporting(): string | undefined;
614
616
  getExporting(): readonly TypedIdentifier[];
@@ -3313,6 +3315,7 @@ export declare interface IEdit {
3313
3315
  declare interface IEventDefinition {
3314
3316
  getName(): string;
3315
3317
  getParameters(): readonly TypedIdentifier[];
3318
+ isStatic(): boolean;
3316
3319
  }
3317
3320
 
3318
3321
  declare class If implements IStructure {
@@ -3351,7 +3354,9 @@ declare interface IFunctionModuleParameter {
3351
3354
  }
3352
3355
 
3353
3356
  declare interface IGlobalConfig {
3354
- /** input files, glob format */
3357
+ /** input files, glob format
3358
+ * @uniqueItems true
3359
+ */
3355
3360
  files: string | string[];
3356
3361
  skipGeneratedBOPFInterfaces?: boolean;
3357
3362
  /** Skips generated table maintenances, determined via TOBJ object */
@@ -3445,6 +3450,8 @@ export declare interface IMethodDefinition extends Identifier {
3445
3450
  isAbstract(): boolean;
3446
3451
  isStatic(): boolean;
3447
3452
  isEventHandler(): boolean;
3453
+ getEventName(): string | undefined;
3454
+ getEventClass(): string | undefined;
3448
3455
  getParameters(): IMethodParameters;
3449
3456
  getRaising(): readonly string[];
3450
3457
  getExceptions(): readonly string[];
@@ -4445,6 +4452,8 @@ declare class MethodDefinition extends Identifier implements IMethodDefinition {
4445
4452
  private readonly parameters;
4446
4453
  private readonly redefinition;
4447
4454
  private readonly eventHandler;
4455
+ private readonly eventName;
4456
+ private readonly eventClass;
4448
4457
  private readonly abstract;
4449
4458
  private readonly static;
4450
4459
  private readonly raising;
@@ -4457,6 +4466,8 @@ declare class MethodDefinition extends Identifier implements IMethodDefinition {
4457
4466
  isAbstract(): boolean;
4458
4467
  isStatic(): boolean;
4459
4468
  isEventHandler(): boolean;
4469
+ getEventName(): string | undefined;
4470
+ getEventClass(): string | undefined;
4460
4471
  getParameters(): MethodParameters_2;
4461
4472
  getRaising(): readonly string[];
4462
4473
  getExceptions(): readonly string[];
@@ -28,6 +28,12 @@ class BuiltInMethod extends _identifier_1.Identifier {
28
28
  getAll() {
29
29
  throw new Error("BuiltInMethod->getAll, Method not implemented");
30
30
  }
31
+ getEventName() {
32
+ return undefined;
33
+ }
34
+ getEventClass() {
35
+ return undefined;
36
+ }
31
37
  getImporting() {
32
38
  const ret = [];
33
39
  for (const i in this.method.mandatory) {
@@ -18,10 +18,14 @@ class EventDefinition extends _identifier_1.Identifier {
18
18
  super(found.getFirstToken(), input.filename);
19
19
  this.parameters = [];
20
20
  this.parse(node, input);
21
+ this.is_static = node.getFirstToken().getStr().toUpperCase() === "CLASS";
21
22
  }
22
23
  getParameters() {
23
24
  return this.parameters;
24
25
  }
26
+ isStatic() {
27
+ return this.is_static;
28
+ }
25
29
  ///////////////
26
30
  parse(node, input) {
27
31
  for (const e of node.findAllExpressions(expressions_1.MethodParam)) {
@@ -9,7 +9,7 @@ const _reference_1 = require("../5_syntax/_reference");
9
9
  class MethodDefinition extends _identifier_1.Identifier {
10
10
  // todo: final flag
11
11
  constructor(node, visibility, input) {
12
- var _a, _b;
12
+ var _a, _b, _c, _d;
13
13
  if (!(node.get() instanceof statements_1.MethodDef)) {
14
14
  throw new Error("MethodDefinition, expected MethodDef as part of input node");
15
15
  }
@@ -31,8 +31,11 @@ class MethodDefinition extends _identifier_1.Identifier {
31
31
  }
32
32
  }
33
33
  this.eventHandler = false;
34
- if (node.findDirectExpression(Expressions.EventHandler)) {
34
+ const handler = node.findDirectExpression(Expressions.EventHandler);
35
+ if (handler) {
35
36
  this.eventHandler = true;
37
+ this.eventName = (_a = handler.findDirectExpression(Expressions.EventName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
38
+ this.eventClass = (_b = handler.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();
36
39
  }
37
40
  this.abstract = false;
38
41
  if (node.findDirectExpression(Expressions.Abstract)) {
@@ -44,7 +47,7 @@ class MethodDefinition extends _identifier_1.Identifier {
44
47
  this.static = true;
45
48
  }
46
49
  this.raising = [];
47
- for (const r of ((_a = node.findDirectExpression(Expressions.MethodDefRaising)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.ClassName)) || []) {
50
+ for (const r of ((_c = node.findDirectExpression(Expressions.MethodDefRaising)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.ClassName)) || []) {
48
51
  const token = r.getFirstToken();
49
52
  const name = token.getStr();
50
53
  this.raising.push(name);
@@ -60,7 +63,7 @@ class MethodDefinition extends _identifier_1.Identifier {
60
63
  }
61
64
  }
62
65
  this.exceptions = [];
63
- for (const r of ((_b = node.findDirectExpression(Expressions.MethodDefExceptions)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.NamespaceSimpleName)) || []) {
66
+ for (const r of ((_d = node.findDirectExpression(Expressions.MethodDefExceptions)) === null || _d === void 0 ? void 0 : _d.findAllExpressions(Expressions.NamespaceSimpleName)) || []) {
64
67
  const token = r.getFirstToken();
65
68
  const name = token.getStr();
66
69
  this.exceptions.push(name);
@@ -86,6 +89,12 @@ class MethodDefinition extends _identifier_1.Identifier {
86
89
  isEventHandler() {
87
90
  return this.eventHandler;
88
91
  }
92
+ getEventName() {
93
+ return this.eventName;
94
+ }
95
+ getEventClass() {
96
+ return this.eventClass;
97
+ }
89
98
  getParameters() {
90
99
  return this.parameters;
91
100
  }
@@ -122,7 +122,7 @@ class Table extends _abstract_object_1.AbstractObject {
122
122
  }
123
123
  if (found instanceof Types.StructureType) {
124
124
  if (field.GROUPNAME !== undefined) {
125
- components.push({ name: field.GROUPNAME, type: found });
125
+ components.push({ name: field.GROUPNAME, type: found, asInclude: true });
126
126
  }
127
127
  if (field.FIELDNAME.startsWith(".INCLU-") === false
128
128
  || field.FIELDNAME === ".INCLU--AP") {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.149";
70
+ return "2.113.151";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MixReturning = exports.MixReturningConf = void 0;
4
+ /* eslint-disable max-len */
4
5
  const issue_1 = require("../issue");
5
6
  const _abap_rule_1 = require("./_abap_rule");
6
7
  const Statements = require("../abap/2_statements/statements");
@@ -20,9 +21,10 @@ class MixReturning extends _abap_rule_1.ABAPRule {
20
21
  key: "mix_returning",
21
22
  title: "Mix of returning and exporting",
22
23
  shortDescription: `Checks that methods don't have a mixture of returning and exporting/changing parameters`,
23
- // eslint-disable-next-line max-len
24
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
25
- tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
24
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination
25
+
26
+ This syntax is not allowed on versions earlier than 740sp02, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abennews-740-abap_objects.htm#!ABAP_MODIFICATION_1@1@`,
27
+ tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Syntax],
26
28
  badExample: `CLASS lcl DEFINITION.
27
29
  PUBLIC SECTION.
28
30
  METHODS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.149",
3
+ "version": "2.113.151",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",