@abaplint/cli 2.102.50 → 2.102.52

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 +45 -14
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -25674,20 +25674,23 @@ class Select {
25674
25674
  if (isDynamic) {
25675
25675
  throw new Error(`dynamic field list, inlining not possible`);
25676
25676
  }
25677
- if (isSimple.test(field.code) && dbSources.length === 1 && dbSources[0] !== undefined) {
25678
- const dbType = dbSources[0].parseType(scope.getRegistry());
25679
- let type = new basic_1.VoidType("SELECT_todo");
25680
- if (dbType instanceof basic_1.StructureType) {
25681
- type = dbType.getComponentByName(field.code);
25682
- if (type === undefined) {
25683
- throw new Error(`handleInto, internal error, should be checked earlier`);
25677
+ let type = new basic_1.VoidType("SELECT_todo");
25678
+ if (isSimple.test(field.code)) {
25679
+ for (const dbSource of dbSources) {
25680
+ if (dbSource === undefined) {
25681
+ continue;
25682
+ }
25683
+ const dbType = dbSource.parseType(scope.getRegistry());
25684
+ if (dbType instanceof basic_1.StructureType) {
25685
+ const found = dbType.getComponentByName(field.code);
25686
+ if (found) {
25687
+ type = found;
25688
+ break;
25689
+ }
25684
25690
  }
25685
25691
  }
25686
- new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
25687
- }
25688
- else {
25689
- new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("SELECT_todo"));
25690
25692
  }
25693
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, type);
25691
25694
  }
25692
25695
  }
25693
25696
  }
@@ -36940,7 +36943,8 @@ class Message {
36940
36943
  return this.message;
36941
36944
  }
36942
36945
  getPlaceholderCount() {
36943
- return (this.getMessage().match(/&/g) || []).length;
36946
+ const escaped = (this.getMessage().match(/&&/g) || []).length;
36947
+ return (this.getMessage().match(/&/g) || []).length - escaped * 2;
36944
36948
  }
36945
36949
  }
36946
36950
  exports.Message = Message;
@@ -49145,7 +49149,7 @@ class Registry {
49145
49149
  }
49146
49150
  static abaplintVersion() {
49147
49151
  // magic, see build script "version.sh"
49148
- return "2.102.50";
49152
+ return "2.102.52";
49149
49153
  }
49150
49154
  getDDICReferences() {
49151
49155
  return this.ddicReferences;
@@ -56160,6 +56164,9 @@ ${indentation} output = ${uniqueName}.\n`;
56160
56164
  else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {
56161
56165
  continue;
56162
56166
  }
56167
+ else if (found.getType() instanceof basic_1.StructureType && found.getType().getQualifiedName() === undefined) {
56168
+ continue;
56169
+ }
56163
56170
  let type = found.getType().getQualifiedName()
56164
56171
  ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
56165
56172
  : found.getType().toABAP();
@@ -61903,6 +61910,11 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
61903
61910
  const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
61904
61911
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
61905
61912
  class MSAGConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
61913
+ constructor() {
61914
+ super(...arguments);
61915
+ /** paramters must be numbered */
61916
+ this.numericParamters = true;
61917
+ }
61906
61918
  }
61907
61919
  exports.MSAGConsistencyConf = MSAGConsistencyConf;
61908
61920
  class MSAGConsistency {
@@ -61936,7 +61948,7 @@ class MSAGConsistency {
61936
61948
  }
61937
61949
  const numbers = new Set();
61938
61950
  for (const message of obj.getMessages()) {
61939
- // todo, get the right positions in xml file
61951
+ // todo, get the right positions in xml file, and report the issue there
61940
61952
  if (!message.getNumber().match(/\d\d\d/)) {
61941
61953
  const text = this.getDescription("Message number must be 3 digits: message " + message.getNumber());
61942
61954
  const position = new position_1.Position(1, 1);
@@ -61959,6 +61971,25 @@ class MSAGConsistency {
61959
61971
  else {
61960
61972
  numbers.add(num);
61961
61973
  }
61974
+ if (this.getConfig().numericParamters === true) {
61975
+ const placeholderCount = message.getPlaceholderCount();
61976
+ if (placeholderCount > 4) {
61977
+ const text = `More than 4 placeholders in mesasge ${message.getNumber()}`;
61978
+ const position = new position_1.Position(1, 1);
61979
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
61980
+ issues.push(issue);
61981
+ }
61982
+ for (let i = 1; i <= placeholderCount; i++) {
61983
+ const placeholder = "&" + i;
61984
+ if (message.getMessage().includes(placeholder) === false) {
61985
+ const text = `Expected placeholder ${placeholder} in message ${message.getNumber()}`;
61986
+ const position = new position_1.Position(1, 1);
61987
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
61988
+ issues.push(issue);
61989
+ break;
61990
+ }
61991
+ }
61992
+ }
61962
61993
  }
61963
61994
  return issues;
61964
61995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.50",
3
+ "version": "2.102.52",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.50",
41
+ "@abaplint/core": "^2.102.52",
42
42
  "@types/chai": "^4.3.6",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.3",
45
45
  "@types/mocha": "^10.0.2",
46
- "@types/node": "^20.7.1",
46
+ "@types/node": "^20.8.0",
47
47
  "@types/progress": "^2.0.5",
48
- "chai": "^4.3.9",
48
+ "chai": "^4.3.10",
49
49
  "chalk": "^5.3.0",
50
50
  "eslint": "^8.50.0",
51
51
  "glob": "^7.2.3",