@abaplint/cli 2.115.16 → 2.115.18

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.
Files changed (2) hide show
  1. package/build/cli.js +49 -17
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -30453,8 +30453,9 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
30453
30453
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
30454
30454
  class Assign {
30455
30455
  runSyntax(node, input) {
30456
- var _a, _b;
30456
+ var _a;
30457
30457
  const assignSource = node.findDirectExpression(Expressions.AssignSource);
30458
+ const isComponent = ((_a = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "COMPONENT";
30458
30459
  const sources = (assignSource === null || assignSource === void 0 ? void 0 : assignSource.findDirectExpressionsMulti([Expressions.Source, Expressions.SimpleSource3])) || [];
30459
30460
  const theSource = sources[sources.length - 1];
30460
30461
  let sourceType = undefined;
@@ -30472,10 +30473,10 @@ class Assign {
30472
30473
  sourceType = basic_1.VoidType.get("Dynamic");
30473
30474
  }
30474
30475
  else {
30475
- sourceType = source_1.Source.runSyntax(theSource, input, undefined, false, true);
30476
+ sourceType = source_1.Source.runSyntax(theSource, input, undefined, false, isComponent === false);
30476
30477
  }
30477
30478
  if ((assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren().length) === 5
30478
- && ((_a = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "COMPONENT") {
30479
+ && isComponent) {
30479
30480
  const componentSource = sources[sources.length - 2];
30480
30481
  const componentType = source_1.Source.runSyntax(componentSource, input);
30481
30482
  if (new _type_utils_1.TypeUtils(input.scope).isAssignable(componentType, new basic_1.CharacterType(30)) === false) {
@@ -30492,7 +30493,7 @@ class Assign {
30492
30493
  }
30493
30494
  const target = node.findDirectExpression(Expressions.FSTarget);
30494
30495
  if (target) {
30495
- if (((_b = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) === "COMPONENT") {
30496
+ if (isComponent) {
30496
30497
  fstarget_1.FSTarget.runSyntax(target, input, basic_1.AnyType.get());
30497
30498
  }
30498
30499
  else {
@@ -40580,7 +40581,7 @@ exports.InterfaceDefinition = InterfaceDefinition;
40580
40581
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40581
40582
  exports.Message = void 0;
40582
40583
  class Message {
40583
- constructor(number, message) {
40584
+ constructor(number, message, className) {
40584
40585
  this.number = number;
40585
40586
  if (this.number === undefined) {
40586
40587
  this.number = "";
@@ -40589,6 +40590,13 @@ class Message {
40589
40590
  if (this.message === undefined) {
40590
40591
  this.message = "";
40591
40592
  }
40593
+ this.className = className;
40594
+ if (this.className === undefined) {
40595
+ this.className = "";
40596
+ }
40597
+ }
40598
+ getMessageClass() {
40599
+ return this.className;
40592
40600
  }
40593
40601
  getNumber() {
40594
40602
  return this.number;
@@ -51008,15 +51016,15 @@ const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "./node_modules/@aba
51008
51016
  class MessageClass extends _abstract_object_1.AbstractObject {
51009
51017
  constructor() {
51010
51018
  super(...arguments);
51011
- this.parsedMessages = undefined;
51019
+ this.xml = undefined;
51012
51020
  }
51013
51021
  getType() {
51014
51022
  return "MSAG";
51015
51023
  }
51016
51024
  getDescription() {
51025
+ var _a;
51017
51026
  this.parseXML();
51018
- // todo
51019
- return undefined;
51027
+ return (_a = this.xml) === null || _a === void 0 ? void 0 : _a.description;
51020
51028
  }
51021
51029
  getAllowedNaming() {
51022
51030
  return {
@@ -51024,13 +51032,18 @@ class MessageClass extends _abstract_object_1.AbstractObject {
51024
51032
  allowNamespace: true,
51025
51033
  };
51026
51034
  }
51035
+ getParsed() {
51036
+ this.parseXML();
51037
+ return this.xml;
51038
+ }
51027
51039
  setDirty() {
51028
- this.parsedMessages = undefined;
51040
+ this.xml = undefined;
51029
51041
  super.setDirty();
51030
51042
  }
51031
51043
  getMessages() {
51044
+ var _a;
51032
51045
  this.parseXML();
51033
- const msg = this.parsedMessages;
51046
+ const msg = (_a = this.xml) === null || _a === void 0 ? void 0 : _a.parsedMessages;
51034
51047
  return msg ? msg : [];
51035
51048
  }
51036
51049
  getByNumber(num) {
@@ -51045,21 +51058,27 @@ class MessageClass extends _abstract_object_1.AbstractObject {
51045
51058
  }
51046
51059
  /////////////////////////////////
51047
51060
  parseXML() {
51048
- var _a, _b;
51049
- if (this.parsedMessages !== undefined) {
51061
+ var _a, _b, _c, _d, _e, _f, _g, _h;
51062
+ if (this.xml !== undefined) {
51050
51063
  return;
51051
51064
  }
51052
- this.parsedMessages = [];
51065
+ this.xml = {
51066
+ topName: undefined,
51067
+ description: undefined,
51068
+ parsedMessages: [],
51069
+ };
51053
51070
  const parsed = super.parseRaw2();
51054
51071
  if (parsed === undefined) {
51055
51072
  return;
51056
51073
  }
51057
- const t100 = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.T100;
51074
+ this.xml.topName = (_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.T100A) === null || _c === void 0 ? void 0 : _c.ARBGB;
51075
+ this.xml.description = (_f = (_e = (_d = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _d === void 0 ? void 0 : _d["asx:abap"]["asx:values"]) === null || _e === void 0 ? void 0 : _e.T100A) === null || _f === void 0 ? void 0 : _f.STEXT;
51076
+ const t100 = (_h = (_g = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _g === void 0 ? void 0 : _g["asx:abap"]["asx:values"]) === null || _h === void 0 ? void 0 : _h.T100;
51058
51077
  if (t100 === undefined) {
51059
51078
  return;
51060
51079
  }
51061
51080
  for (const msg of (0, xml_utils_1.xmlToArray)(t100.T100)) {
51062
- this.parsedMessages.push(new message_1.Message(msg.MSGNR, (0, xml_utils_1.unescape)(msg.TEXT)));
51081
+ this.xml.parsedMessages.push(new message_1.Message(msg.MSGNR, (0, xml_utils_1.unescape)(msg.TEXT), msg.ARBGB));
51063
51082
  }
51064
51083
  }
51065
51084
  }
@@ -55438,7 +55457,7 @@ class Registry {
55438
55457
  }
55439
55458
  static abaplintVersion() {
55440
55459
  // magic, see build script "version.sh"
55441
- return "2.115.16";
55460
+ return "2.115.18";
55442
55461
  }
55443
55462
  getDDICReferences() {
55444
55463
  return this.ddicReferences;
@@ -55652,7 +55671,7 @@ class Registry {
55652
55671
  return this;
55653
55672
  }
55654
55673
  ParsingPerformance.clear();
55655
- (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().normal, "Lexing and parsing");
55674
+ (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().total, "Lexing and parsing");
55656
55675
  for (const o of this.getObjects()) {
55657
55676
  await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick("Lexing and parsing(" + this.conf.getVersion() + ") - " + o.getType() + " " + o.getName()));
55658
55677
  this.parsePrivate(o);
@@ -69833,6 +69852,7 @@ class MSAGConsistency {
69833
69852
  return this;
69834
69853
  }
69835
69854
  run(obj) {
69855
+ var _a, _b;
69836
69856
  const issues = [];
69837
69857
  if (!(obj instanceof objects_1.MessageClass)) {
69838
69858
  return [];
@@ -69881,6 +69901,18 @@ class MSAGConsistency {
69881
69901
  }
69882
69902
  }
69883
69903
  }
69904
+ if (message.getMessageClass() !== obj.getName()) {
69905
+ const text = `Message class "${message.getMessageClass()}" does not match filename "${obj.getName()}" for message ${message.getNumber()}`;
69906
+ const position = new position_1.Position(1, 1);
69907
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
69908
+ issues.push(issue);
69909
+ }
69910
+ }
69911
+ if (((_a = obj.getParsed()) === null || _a === void 0 ? void 0 : _a.topName) !== obj.getName()) {
69912
+ const text = `Message class name "${(_b = obj.getParsed()) === null || _b === void 0 ? void 0 : _b.topName}" does not match filename "${obj.getName()}"`;
69913
+ const position = new position_1.Position(1, 1);
69914
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
69915
+ issues.push(issue);
69884
69916
  }
69885
69917
  return issues;
69886
69918
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.115.16",
3
+ "version": "2.115.18",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,11 +38,11 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.115.16",
41
+ "@abaplint/core": "^2.115.18",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",
45
- "@types/node": "^24.10.4",
45
+ "@types/node": "^24.10.9",
46
46
  "@types/progress": "^2.0.7",
47
47
  "chai": "^4.5.0",
48
48
  "p-limit": "^3.1.0",
@@ -50,7 +50,7 @@
50
50
  "eslint": "^9.39.2",
51
51
  "glob": "^11.0.3",
52
52
  "json5": "^2.2.3",
53
- "memfs": "^4.51.1",
53
+ "memfs": "^4.56.10",
54
54
  "minimist": "^1.2.8",
55
55
  "mocha": "^11.7.5",
56
56
  "progress": "^2.0.3",