@abaplint/cli 2.101.8 → 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 +92 -2
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -21681,6 +21681,11 @@ class TypeUtils {
21681
21681
  }
21682
21682
  return true;
21683
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
+ }
21684
21689
  return this.isAssignable(source, target);
21685
21690
  }
21686
21691
  isAssignable(source, target) {
@@ -26604,6 +26609,15 @@ class SpaghettiScopeNode extends ScopeData {
26604
26609
  }
26605
26610
  return undefined;
26606
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
+ }
26607
26621
  findFormDefinition(name) {
26608
26622
  let search = this;
26609
26623
  const upper = name.toUpperCase();
@@ -34698,6 +34712,7 @@ __exportStar(__webpack_require__(/*! ./floating_point_type */ "./node_modules/@a
34698
34712
  __exportStar(__webpack_require__(/*! ./generic_object_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/generic_object_reference_type.js"), exports);
34699
34713
  __exportStar(__webpack_require__(/*! ./hex_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/hex_type.js"), exports);
34700
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);
34701
34716
  __exportStar(__webpack_require__(/*! ./numeric_generic_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_generic_type.js"), exports);
34702
34717
  __exportStar(__webpack_require__(/*! ./numeric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/numeric_type.js"), exports);
34703
34718
  __exportStar(__webpack_require__(/*! ./object_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/object_reference_type.js"), exports);
@@ -34716,6 +34731,39 @@ __exportStar(__webpack_require__(/*! ./xstring_type */ "./node_modules/@abaplint
34716
34731
 
34717
34732
  /***/ }),
34718
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
+
34719
34767
  /***/ "./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js":
34720
34768
  /*!********************************************************************************!*\
34721
34769
  !*** ./node_modules/@abaplint/core/build/src/abap/types/basic/integer_type.js ***!
@@ -38175,8 +38223,9 @@ class DDIC {
38175
38223
  case "CSEQUENCE":
38176
38224
  return new Types.CSequenceType({ qualifiedName: qualifiedName });
38177
38225
  case "I":
38178
- case "INT8": // todo, take version into account
38179
38226
  return new Types.IntegerType({ qualifiedName: qualifiedName || name });
38227
+ case "INT8": // todo, take version into account
38228
+ return new Types.Integer8Type({ qualifiedName: qualifiedName || name });
38180
38229
  case "F":
38181
38230
  return new Types.FloatType({ qualifiedName: qualifiedName || name });
38182
38231
  case "P":
@@ -39579,6 +39628,7 @@ const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ ".
39579
39628
  const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
39580
39629
  class LSPLookup {
39581
39630
  static lookup(cursor, reg, obj) {
39631
+ var _a, _b;
39582
39632
  const inc = this.findInclude(cursor, reg);
39583
39633
  if (inc) {
39584
39634
  const found = this.ABAPFileResult(inc);
@@ -39648,6 +39698,22 @@ class LSPLookup {
39648
39698
  }
39649
39699
  return { hover: hoverValue, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
39650
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
+ }
39651
39717
  const refs = this.searchReferences(bottomScope, cursor.token);
39652
39718
  if (refs.length > 0) {
39653
39719
  for (const ref of refs) {
@@ -41055,11 +41121,13 @@ const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identif
41055
41121
  const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
41056
41122
  const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@abaplint/core/build/src/lsp/references.js");
41057
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");
41058
41125
  var RenameType;
41059
41126
  (function (RenameType) {
41060
41127
  RenameType[RenameType["GlobalClass"] = 1] = "GlobalClass";
41061
41128
  RenameType[RenameType["Variable"] = 2] = "Variable";
41062
41129
  RenameType[RenameType["GlobalInterface"] = 3] = "GlobalInterface";
41130
+ RenameType[RenameType["Method"] = 4] = "Method";
41063
41131
  })(RenameType = exports.RenameType || (exports.RenameType = {}));
41064
41132
  class Rename {
41065
41133
  constructor(reg) {
@@ -41089,6 +41157,9 @@ class Rename {
41089
41157
  else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.InterfaceDefinition) {
41090
41158
  return { range, placeholder: cursor.token.getStr(), type: RenameType.GlobalInterface, file };
41091
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
+ }
41092
41163
  return undefined;
41093
41164
  }
41094
41165
  rename(params) {
@@ -41103,6 +41174,8 @@ class Rename {
41103
41174
  return new renamer_1.Renamer(this.reg).buildEdits("INTF", prepare.placeholder, params.newName);
41104
41175
  case RenameType.Variable:
41105
41176
  return this.renameVariable(params);
41177
+ case RenameType.Method:
41178
+ return this.renameMethod(params);
41106
41179
  default:
41107
41180
  return undefined;
41108
41181
  }
@@ -41119,6 +41192,23 @@ class Rename {
41119
41192
  }
41120
41193
  return workspace;
41121
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
+ }
41122
41212
  }
41123
41213
  exports.Rename = Rename;
41124
41214
  //# sourceMappingURL=rename.js.map
@@ -48065,7 +48155,7 @@ class Registry {
48065
48155
  }
48066
48156
  static abaplintVersion() {
48067
48157
  // magic, see build script "version.sh"
48068
- return "2.101.8";
48158
+ return "2.101.9";
48069
48159
  }
48070
48160
  getDDICReferences() {
48071
48161
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.101.8",
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.8",
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",