@abaplint/cli 2.101.15 → 2.101.16

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 +69 -11
  2. package/package.json +5 -5
package/build/cli.js CHANGED
@@ -21508,6 +21508,7 @@ class TypeUtils {
21508
21508
  else if (type instanceof basic_1.XStringType
21509
21509
  || type instanceof basic_1.HexType
21510
21510
  || type instanceof basic_1.VoidType
21511
+ || type instanceof basic_1.XGenericType
21511
21512
  || type instanceof basic_1.XSequenceType
21512
21513
  || type instanceof basic_1.AnyType
21513
21514
  || type instanceof basic_1.UnknownType) {
@@ -21850,7 +21851,7 @@ class BasicTypes {
21850
21851
  }
21851
21852
  lookupQualifiedName(name) {
21852
21853
  var _a;
21853
- // argh, todo, rewrite this entire method, more argh
21854
+ // argh, todo, rewrite this entire method, more argh, again argh
21854
21855
  if (name === undefined) {
21855
21856
  return undefined;
21856
21857
  }
@@ -21871,7 +21872,10 @@ class BasicTypes {
21871
21872
  const stru = oo.getTypeDefinitions().getByName(subTypeName);
21872
21873
  const struType = stru === null || stru === void 0 ? void 0 : stru.getType();
21873
21874
  if (stru && struType instanceof basic_1.StructureType) {
21874
- const f = struType.getComponentByName(fieldName);
21875
+ let f = struType.getComponentByName(fieldName);
21876
+ if (split[2] && f instanceof basic_1.StructureType) {
21877
+ f = f.getComponentByName(split[2]);
21878
+ }
21875
21879
  if (f) {
21876
21880
  return new _typed_identifier_1.TypedIdentifier(stru.getToken(), stru.getFilename(), f);
21877
21881
  }
@@ -21893,7 +21897,10 @@ class BasicTypes {
21893
21897
  if (type) {
21894
21898
  const stru = type.getType();
21895
21899
  if (stru instanceof basic_1.StructureType) {
21896
- const f = stru.getComponentByName(fieldName);
21900
+ let f = stru.getComponentByName(fieldName);
21901
+ if (split[2] && f instanceof basic_1.StructureType) {
21902
+ f = f.getComponentByName(split[2]);
21903
+ }
21897
21904
  if (f) {
21898
21905
  return new _typed_identifier_1.TypedIdentifier(type.getToken(), type.getFilename(), f);
21899
21906
  }
@@ -24699,6 +24706,9 @@ class MethodParam {
24699
24706
  if (concat === "TYPE C" || concat.startsWith("TYPE C ")) {
24700
24707
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new cgeneric_type_1.CGenericType(), meta);
24701
24708
  }
24709
+ else if (concat === "TYPE X" || concat.startsWith("TYPE X ")) {
24710
+ return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, new basic_1.XGenericType(), meta);
24711
+ }
24702
24712
  const found = new basic_types_1.BasicTypes(filename, scope).parseType(type);
24703
24713
  if (found) {
24704
24714
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), filename, found, meta);
@@ -34708,7 +34718,7 @@ class HexType extends _abstract_type_1.AbstractType {
34708
34718
  constructor(length, qualifiedName) {
34709
34719
  super({ qualifiedName: qualifiedName });
34710
34720
  if (length <= 0) {
34711
- throw new Error("Bad LENGTHm, Hex");
34721
+ throw new Error("Bad LENGTH, Hex");
34712
34722
  }
34713
34723
  this.length = length;
34714
34724
  }
@@ -34787,6 +34797,7 @@ __exportStar(__webpack_require__(/*! ./time_type */ "./node_modules/@abaplint/co
34787
34797
  __exportStar(__webpack_require__(/*! ./unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js"), exports);
34788
34798
  __exportStar(__webpack_require__(/*! ./utc_long_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/utc_long_type.js"), exports);
34789
34799
  __exportStar(__webpack_require__(/*! ./void_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js"), exports);
34800
+ __exportStar(__webpack_require__(/*! ./xgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js"), exports);
34790
34801
  __exportStar(__webpack_require__(/*! ./xsequence_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js"), exports);
34791
34802
  __exportStar(__webpack_require__(/*! ./xstring_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/xstring_type.js"), exports);
34792
34803
  //# sourceMappingURL=index.js.map
@@ -35427,6 +35438,39 @@ exports.VoidType = VoidType;
35427
35438
 
35428
35439
  /***/ }),
35429
35440
 
35441
+ /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js":
35442
+ /*!*********************************************************************************!*\
35443
+ !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/xgeneric_type.js ***!
35444
+ \*********************************************************************************/
35445
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
35446
+
35447
+ "use strict";
35448
+
35449
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35450
+ exports.XGenericType = void 0;
35451
+ const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
35452
+ class XGenericType extends _abstract_type_1.AbstractType {
35453
+ toText() {
35454
+ return "```x```";
35455
+ }
35456
+ isGeneric() {
35457
+ return true;
35458
+ }
35459
+ toABAP() {
35460
+ throw new Error("x, generic");
35461
+ }
35462
+ containsVoid() {
35463
+ return false;
35464
+ }
35465
+ toCDS() {
35466
+ return "abap.TODO_CGENERIC";
35467
+ }
35468
+ }
35469
+ exports.XGenericType = XGenericType;
35470
+ //# sourceMappingURL=xgeneric_type.js.map
35471
+
35472
+ /***/ }),
35473
+
35430
35474
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js":
35431
35475
  /*!**********************************************************************************!*\
35432
35476
  !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/xsequence_type.js ***!
@@ -48352,7 +48396,7 @@ class Registry {
48352
48396
  }
48353
48397
  static abaplintVersion() {
48354
48398
  // magic, see build script "version.sh"
48355
- return "2.101.15";
48399
+ return "2.101.16";
48356
48400
  }
48357
48401
  getDDICReferences() {
48358
48402
  return this.ddicReferences;
@@ -48993,7 +49037,9 @@ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */
48993
49037
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
48994
49038
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
48995
49039
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
49040
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
48996
49041
  const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
49042
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
48997
49043
  class AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {
48998
49044
  }
48999
49045
  exports.AlignParametersConf = AlignParametersConf;
@@ -49020,7 +49066,8 @@ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-par
49020
49066
 
49021
49067
  Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
49022
49068
 
49023
- Also https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,
49069
+ If parameters are on the same row, no issues are reported, see
49070
+ https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
49024
49071
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],
49025
49072
  badExample: `CALL FUNCTION 'FOOBAR'
49026
49073
  EXPORTING
@@ -49083,16 +49130,28 @@ DATA(sdf) = VALUE type(
49083
49130
  return undefined;
49084
49131
  }
49085
49132
  let expectedEqualsColumn = 0;
49133
+ let row = 0;
49086
49134
  for (const p of candidate.parameters) {
49087
49135
  const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;
49136
+ if (p.eq.getRow() === row) {
49137
+ return undefined;
49138
+ }
49139
+ row = p.eq.getRow();
49088
49140
  if (currentCol > expectedEqualsColumn) {
49089
49141
  expectedEqualsColumn = currentCol;
49090
49142
  }
49091
49143
  }
49092
49144
  for (const p of candidate.parameters) {
49093
49145
  if (p.eq.getCol() !== expectedEqualsColumn) {
49146
+ let fix;
49147
+ if (p.eq.getCol() < expectedEqualsColumn) {
49148
+ fix = edit_helper_1.EditHelper.insertAt(file, p.eq, " ".repeat(expectedEqualsColumn - p.eq.getCol()));
49149
+ }
49150
+ else {
49151
+ fix = edit_helper_1.EditHelper.deleteRange(file, new position_1.Position(p.eq.getRow(), expectedEqualsColumn), p.eq);
49152
+ }
49094
49153
  const message = "Align parameters to column " + expectedEqualsColumn;
49095
- return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key, this.getConfig().severity);
49154
+ return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key, this.getConfig().severity, fix);
49096
49155
  }
49097
49156
  }
49098
49157
  return undefined;
@@ -56885,11 +56944,11 @@ DATA lt_bar TYPE STANDARD TABLE OF ty.`,
56885
56944
  const concat = tt.concatTokens().toUpperCase();
56886
56945
  if (concat.includes("TYPE TABLE OF")) {
56887
56946
  const message = "Specify table type";
56888
- issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
56947
+ issues.push(issue_1.Issue.atPosition(file, tt.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity));
56889
56948
  }
56890
56949
  else if (concat.includes(" WITH ") === false && concat.includes(" RANGE OF ") === false) {
56891
56950
  const message = "Specify table key";
56892
- issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
56951
+ issues.push(issue_1.Issue.atPosition(file, tt.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity));
56893
56952
  }
56894
56953
  }
56895
56954
  return issues;
@@ -64669,7 +64728,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
64669
64728
  exports.SelectSingleFullKey = exports.SelectSingleFullKeyConf = void 0;
64670
64729
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
64671
64730
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
64672
- const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
64673
64731
  const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/index.js");
64674
64732
  class SelectSingleFullKeyConf extends _basic_rule_config_1.BasicRuleConfig {
64675
64733
  constructor() {
@@ -64689,7 +64747,7 @@ class SelectSingleFullKey {
64689
64747
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
64690
64748
  extendedInformation: `Table definitions must be known, ie. inside the errorNamespace`,
64691
64749
  pseudoComment: "EC CI_NOORDER",
64692
- tags: [_irule_1.RuleTag.Experimental],
64750
+ tags: [],
64693
64751
  };
64694
64752
  }
64695
64753
  initialize(reg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.101.15",
3
+ "version": "2.101.16",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.101.15",
41
+ "@abaplint/core": "^2.101.16",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",
@@ -50,13 +50,13 @@
50
50
  "eslint": "^8.42.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
- "memfs": "^3.5.2",
53
+ "memfs": "^3.5.3",
54
54
  "minimist": "^1.2.8",
55
55
  "mocha": "^10.2.0",
56
56
  "progress": "^2.0.3",
57
57
  "typescript": "^5.1.3",
58
- "webpack": "^5.85.1",
59
- "webpack-cli": "^5.1.3",
58
+ "webpack": "^5.86.0",
59
+ "webpack-cli": "^5.1.4",
60
60
  "xml-js": "^1.6.11"
61
61
  },
62
62
  "dependencies": {}