@abaplint/cli 2.101.7 → 2.101.9

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 +125 -6
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -5192,6 +5192,7 @@ __exportStar(__webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/
5192
5192
  __exportStar(__webpack_require__(/*! ./sql_aggregation */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js"), exports);
5193
5193
  __exportStar(__webpack_require__(/*! ./sql_alias_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_alias_field.js"), exports);
5194
5194
  __exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
5195
+ __exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js"), exports);
5195
5196
  __exportStar(__webpack_require__(/*! ./sql_as_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_as_name.js"), exports);
5196
5197
  __exportStar(__webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js"), exports);
5197
5198
  __exportStar(__webpack_require__(/*! ./sql_cds_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js"), exports);
@@ -7106,6 +7107,29 @@ exports.SQLAliasField = SQLAliasField;
7106
7107
 
7107
7108
  /***/ }),
7108
7109
 
7110
+ /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js":
7111
+ /*!********************************************************************************************************!*\
7112
+ !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js ***!
7113
+ \********************************************************************************************************/
7114
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7115
+
7116
+ "use strict";
7117
+
7118
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
7119
+ exports.SQLArithmeticOperator = void 0;
7120
+ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7121
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
7122
+ class SQLArithmeticOperator extends combi_1.Expression {
7123
+ getRunnable() {
7124
+ const operator = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlusW), (0, combi_1.tok)(tokens_1.WDashW), "*", "/");
7125
+ return operator;
7126
+ }
7127
+ }
7128
+ exports.SQLArithmeticOperator = SQLArithmeticOperator;
7129
+ //# sourceMappingURL=sql_arithmetic_operator.js.map
7130
+
7131
+ /***/ }),
7132
+
7109
7133
  /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js":
7110
7134
  /*!************************************************************************************************!*\
7111
7135
  !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js ***!
@@ -7118,12 +7142,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
7118
7142
  exports.SQLArithmetics = void 0;
7119
7143
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7120
7144
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
7121
- const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
7145
+ const sql_arithmetic_operator_1 = __webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js");
7122
7146
  class SQLArithmetics extends combi_1.Expression {
7123
7147
  getRunnable() {
7124
- const operator = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlusW), (0, combi_1.tok)(tokens_1.WDashW), "*", "/");
7125
7148
  const field = (0, combi_1.alt)(_1.SQLFieldName, _1.SQLFunction);
7126
- return (0, combi_1.seq)(field, (0, combi_1.starPrio)((0, combi_1.seq)(operator, field)));
7149
+ return (0, combi_1.seq)(field, (0, combi_1.starPrio)((0, combi_1.seq)(sql_arithmetic_operator_1.SQLArithmeticOperator, field)));
7127
7150
  }
7128
7151
  }
7129
7152
  exports.SQLArithmetics = SQLArithmetics;
@@ -7360,11 +7383,14 @@ exports.SQLField = SQLField;
7360
7383
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7361
7384
  exports.SQLFieldAndValue = void 0;
7362
7385
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7386
+ const integer_1 = __webpack_require__(/*! ./integer */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/integer.js");
7387
+ const sql_arithmetic_operator_1 = __webpack_require__(/*! ./sql_arithmetic_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetic_operator.js");
7363
7388
  const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js");
7364
7389
  const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source.js");
7365
7390
  class SQLFieldAndValue extends combi_1.Expression {
7366
7391
  getRunnable() {
7367
- const param = (0, combi_1.seq)(sql_field_name_1.SQLFieldName, "=", sql_source_1.SQLSource);
7392
+ const opt1 = (0, combi_1.seq)((0, combi_1.altPrio)(integer_1.Integer, sql_field_name_1.SQLFieldName), sql_arithmetic_operator_1.SQLArithmeticOperator, sql_source_1.SQLSource);
7393
+ const param = (0, combi_1.seq)(sql_field_name_1.SQLFieldName, "=", (0, combi_1.altPrio)(opt1, sql_source_1.SQLSource));
7368
7394
  return param;
7369
7395
  }
7370
7396
  }
@@ -21655,6 +21681,11 @@ class TypeUtils {
21655
21681
  }
21656
21682
  return true;
21657
21683
  }
21684
+ else if (source instanceof basic_1.Integer8Type) {
21685
+ if (target instanceof basic_1.IntegerType || target instanceof basic_1.StringType) {
21686
+ return false;
21687
+ }
21688
+ }
21658
21689
  return this.isAssignable(source, target);
21659
21690
  }
21660
21691
  isAssignable(source, target) {
@@ -26578,6 +26609,15 @@ class SpaghettiScopeNode extends ScopeData {
26578
26609
  }
26579
26610
  return undefined;
26580
26611
  }
26612
+ listClassDefinitions() {
26613
+ let search = this;
26614
+ const ret = [];
26615
+ while (search !== undefined) {
26616
+ ret.push(...Object.values(search.getData().cdefs));
26617
+ search = search.getParent();
26618
+ }
26619
+ return ret;
26620
+ }
26581
26621
  findFormDefinition(name) {
26582
26622
  let search = this;
26583
26623
  const upper = name.toUpperCase();
@@ -34672,6 +34712,7 @@ __exportStar(__webpack_require__(/*! ./floating_point_type */ "./node_modules/@a
34672
34712
  __exportStar(__webpack_require__(/*! ./generic_object_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/generic_object_reference_type.js"), exports);
34673
34713
  __exportStar(__webpack_require__(/*! ./hex_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/hex_type.js"), exports);
34674
34714
  __exportStar(__webpack_require__(/*! ./integer_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js"), exports);
34715
+ __exportStar(__webpack_require__(/*! ./integer8_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/integer8_type.js"), exports);
34675
34716
  __exportStar(__webpack_require__(/*! ./numeric_generic_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_generic_type.js"), exports);
34676
34717
  __exportStar(__webpack_require__(/*! ./numeric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_type.js"), exports);
34677
34718
  __exportStar(__webpack_require__(/*! ./object_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js"), exports);
@@ -34690,6 +34731,39 @@ __exportStar(__webpack_require__(/*! ./xstring_type */ "./node_modules/@abaplint
34690
34731
 
34691
34732
  /***/ }),
34692
34733
 
34734
+ /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/integer8_type.js":
34735
+ /*!*********************************************************************************!*\
34736
+ !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/integer8_type.js ***!
34737
+ \*********************************************************************************/
34738
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
34739
+
34740
+ "use strict";
34741
+
34742
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34743
+ exports.Integer8Type = void 0;
34744
+ const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
34745
+ class Integer8Type extends _abstract_type_1.AbstractType {
34746
+ toText() {
34747
+ return "```int8```";
34748
+ }
34749
+ isGeneric() {
34750
+ return false;
34751
+ }
34752
+ toABAP() {
34753
+ return "int8";
34754
+ }
34755
+ containsVoid() {
34756
+ return false;
34757
+ }
34758
+ toCDS() {
34759
+ return "abap.int8";
34760
+ }
34761
+ }
34762
+ exports.Integer8Type = Integer8Type;
34763
+ //# sourceMappingURL=integer8_type.js.map
34764
+
34765
+ /***/ }),
34766
+
34693
34767
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js":
34694
34768
  /*!********************************************************************************!*\
34695
34769
  !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js ***!
@@ -38149,8 +38223,9 @@ class DDIC {
38149
38223
  case "CSEQUENCE":
38150
38224
  return new Types.CSequenceType({ qualifiedName: qualifiedName });
38151
38225
  case "I":
38152
- case "INT8": // todo, take version into account
38153
38226
  return new Types.IntegerType({ qualifiedName: qualifiedName || name });
38227
+ case "INT8": // todo, take version into account
38228
+ return new Types.Integer8Type({ qualifiedName: qualifiedName || name });
38154
38229
  case "F":
38155
38230
  return new Types.FloatType({ qualifiedName: qualifiedName || name });
38156
38231
  case "P":
@@ -39553,6 +39628,7 @@ const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ ".
39553
39628
  const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
39554
39629
  class LSPLookup {
39555
39630
  static lookup(cursor, reg, obj) {
39631
+ var _a, _b;
39556
39632
  const inc = this.findInclude(cursor, reg);
39557
39633
  if (inc) {
39558
39634
  const found = this.ABAPFileResult(inc);
@@ -39622,6 +39698,22 @@ class LSPLookup {
39622
39698
  }
39623
39699
  return { hover: hoverValue, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
39624
39700
  }
39701
+ for (const c of bottomScope.listClassDefinitions()) {
39702
+ for (const m of ((_a = c.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
39703
+ for (const p of ((_b = m.getParameters()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
39704
+ if (p.getStart().equals(cursor.token.getStart())) {
39705
+ const found = _lsp_utils_1.LSPUtils.identiferToLocation(p);
39706
+ return {
39707
+ hover: "Method Parameter, " + cursor.token.getStr(),
39708
+ definition: found,
39709
+ definitionId: p,
39710
+ implementation: undefined,
39711
+ scope: bottomScope,
39712
+ };
39713
+ }
39714
+ }
39715
+ }
39716
+ }
39625
39717
  const refs = this.searchReferences(bottomScope, cursor.token);
39626
39718
  if (refs.length > 0) {
39627
39719
  for (const ref of refs) {
@@ -41029,11 +41121,13 @@ const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identif
41029
41121
  const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
41030
41122
  const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@abaplint/core/build/src/lsp/references.js");
41031
41123
  const renamer_1 = __webpack_require__(/*! ../objects/rename/renamer */ "./node_modules/@abaplint/core/build/src/objects/rename/renamer.js");
41124
+ const definition_1 = __webpack_require__(/*! ./definition */ "./node_modules/@abaplint/core/build/src/lsp/definition.js");
41032
41125
  var RenameType;
41033
41126
  (function (RenameType) {
41034
41127
  RenameType[RenameType["GlobalClass"] = 1] = "GlobalClass";
41035
41128
  RenameType[RenameType["Variable"] = 2] = "Variable";
41036
41129
  RenameType[RenameType["GlobalInterface"] = 3] = "GlobalInterface";
41130
+ RenameType[RenameType["Method"] = 4] = "Method";
41037
41131
  })(RenameType = exports.RenameType || (exports.RenameType = {}));
41038
41132
  class Rename {
41039
41133
  constructor(reg) {
@@ -41063,6 +41157,9 @@ class Rename {
41063
41157
  else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.InterfaceDefinition) {
41064
41158
  return { range, placeholder: cursor.token.getStr(), type: RenameType.GlobalInterface, file };
41065
41159
  }
41160
+ else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.MethodDefinition) {
41161
+ return { range, placeholder: cursor.token.getStr(), type: RenameType.Method, file };
41162
+ }
41066
41163
  return undefined;
41067
41164
  }
41068
41165
  rename(params) {
@@ -41077,6 +41174,8 @@ class Rename {
41077
41174
  return new renamer_1.Renamer(this.reg).buildEdits("INTF", prepare.placeholder, params.newName);
41078
41175
  case RenameType.Variable:
41079
41176
  return this.renameVariable(params);
41177
+ case RenameType.Method:
41178
+ return this.renameMethod(params);
41080
41179
  default:
41081
41180
  return undefined;
41082
41181
  }
@@ -41093,6 +41192,23 @@ class Rename {
41093
41192
  }
41094
41193
  return workspace;
41095
41194
  }
41195
+ renameMethod(params) {
41196
+ var _a, _b;
41197
+ const workspace = { documentChanges: [] };
41198
+ const refs = new references_1.References(this.reg).references(params);
41199
+ for (const r of refs) {
41200
+ const doc = { uri: r.uri, version: 1 };
41201
+ const edit = LServer.TextDocumentEdit.create(doc, [LServer.TextEdit.replace(r.range, params.newName)]);
41202
+ (_a = workspace.documentChanges) === null || _a === void 0 ? void 0 : _a.push(edit);
41203
+ }
41204
+ const def = new definition_1.Definition(this.reg).find(params.textDocument, params.position);
41205
+ if (def) {
41206
+ const doc = { uri: params.textDocument.uri, version: 1 };
41207
+ const edit = LServer.TextDocumentEdit.create(doc, [LServer.TextEdit.replace(def === null || def === void 0 ? void 0 : def.range, params.newName)]);
41208
+ (_b = workspace.documentChanges) === null || _b === void 0 ? void 0 : _b.push(edit);
41209
+ }
41210
+ return workspace;
41211
+ }
41096
41212
  }
41097
41213
  exports.Rename = Rename;
41098
41214
  //# sourceMappingURL=rename.js.map
@@ -48039,7 +48155,7 @@ class Registry {
48039
48155
  }
48040
48156
  static abaplintVersion() {
48041
48157
  // magic, see build script "version.sh"
48042
- return "2.101.7";
48158
+ return "2.101.9";
48043
48159
  }
48044
48160
  getDDICReferences() {
48045
48161
  return this.ddicReferences;
@@ -53490,6 +53606,9 @@ ${indentation}ENDIF.
53490
53606
  ${indentation}`);
53491
53607
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
53492
53608
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
53609
+ if (high.get() instanceof Statements.ElseIf) {
53610
+ throw "downport, unable to downport table expression in ELSEIF";
53611
+ }
53493
53612
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline table expression", this.getMetadata().key, this.conf.severity, fix);
53494
53613
  }
53495
53614
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.101.7",
3
+ "version": "2.101.9",
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.7",
41
+ "@abaplint/core": "^2.101.9",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",