@abaplint/cli 2.102.13 → 2.102.15

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 +36 -23
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -21424,6 +21424,7 @@ var ScopeType;
21424
21424
  ScopeType["FunctionModule"] = "function";
21425
21425
  ScopeType["Method"] = "method";
21426
21426
  ScopeType["MethodInstance"] = "method_instance";
21427
+ ScopeType["MethodDefinition"] = "method_definition";
21427
21428
  ScopeType["For"] = "for";
21428
21429
  ScopeType["Let"] = "let";
21429
21430
  ScopeType["OpenSQL"] = "open_sql";
@@ -29108,7 +29109,7 @@ class IncludeType {
29108
29109
  const components = [];
29109
29110
  for (const c of ityp.getComponents()) {
29110
29111
  if (c.name === as) {
29111
- components.push(c);
29112
+ components.push(Object.assign(Object.assign({}, c), { renamingSuffix: suffix }));
29112
29113
  continue;
29113
29114
  }
29114
29115
  components.push({
@@ -29583,11 +29584,12 @@ class MethodImplementation {
29583
29584
  if (methodDefinition === undefined) {
29584
29585
  throw new Error("Method definition \"" + methodName + "\" not found");
29585
29586
  }
29587
+ const start = node.getFirstToken().getStart();
29586
29588
  if (methodDefinition.isStatic() === false) {
29587
- scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, node.getFirstToken().getStart(), filename);
29589
+ scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, start, filename);
29588
29590
  scope.addList(classDefinition.getAttributes().getInstance());
29589
29591
  }
29590
- scope.push(_scope_type_1.ScopeType.Method, methodName, node.getFirstToken().getStart(), filename);
29592
+ scope.push(_scope_type_1.ScopeType.Method, methodName, start, filename);
29591
29593
  scope.addReference(methodToken, methodDefinition, _reference_1.ReferenceType.MethodImplementationReference, filename);
29592
29594
  scope.addList(methodDefinition.getParameters().getAll());
29593
29595
  for (const i of helper.findInterfaces(classDefinition)) {
@@ -36787,6 +36789,7 @@ const method_param_1 = __webpack_require__(/*! ../5_syntax/expressions/method_pa
36787
36789
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
36788
36790
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
36789
36791
  const identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js");
36792
+ const _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
36790
36793
  // todo:
36791
36794
  // this.exceptions = [];
36792
36795
  // also consider RAISING vs EXCEPTIONS
@@ -36804,7 +36807,11 @@ class MethodParameters {
36804
36807
  this.preferred = undefined;
36805
36808
  this.exceptions = [];
36806
36809
  this.filename = filename;
36807
- this.parse(node, scope, filename);
36810
+ // need the scope for LIKE typing inside method parameters
36811
+ const parentName = scope.getName();
36812
+ scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), filename);
36813
+ this.parse(node, scope, filename, parentName);
36814
+ scope.pop(node.getEnd());
36808
36815
  }
36809
36816
  getFilename() {
36810
36817
  return this.filename;
@@ -36879,7 +36886,7 @@ class MethodParameters {
36879
36886
  return this.defaults[parameter.toUpperCase()];
36880
36887
  }
36881
36888
  ///////////////////
36882
- parse(node, scope, filename) {
36889
+ parse(node, scope, filename, parentName) {
36883
36890
  var _a, _b;
36884
36891
  const handler = node.findFirstExpression(Expressions.EventHandler);
36885
36892
  if (handler) {
@@ -36939,9 +36946,9 @@ class MethodParameters {
36939
36946
  if (returning) {
36940
36947
  this.returning = new method_def_returning_1.MethodDefReturning().runSyntax(returning, scope, this.filename, ["returning" /* IdentifierMeta.MethodReturning */]);
36941
36948
  }
36942
- this.workaroundRAP(node, scope, filename);
36949
+ this.workaroundRAP(node, scope, filename, parentName);
36943
36950
  }
36944
- workaroundRAP(node, scope, filename) {
36951
+ workaroundRAP(node, _scope, filename, parentName) {
36945
36952
  const resultName = node.findExpressionAfterToken("RESULT");
36946
36953
  const isRap = node.findExpressionAfterToken("IMPORTING");
36947
36954
  if (isRap) {
@@ -36966,7 +36973,7 @@ class MethodParameters {
36966
36973
  this.importing.push(new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
36967
36974
  }
36968
36975
  // its some kind of magic
36969
- if (scope.getName().toUpperCase() === "CL_ABAP_BEHAVIOR_SAVER") {
36976
+ if (parentName.toUpperCase() === "CL_ABAP_BEHAVIOR_SAVER") {
36970
36977
  const tempChanging = this.changing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
36971
36978
  while (this.changing.length > 0) {
36972
36979
  this.changing.shift();
@@ -36993,7 +37000,9 @@ class MethodParameters {
36993
37000
  else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
36994
37001
  extraMeta.push("read_only" /* IdentifierMeta.ReadOnly */);
36995
37002
  }
36996
- target.push(new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]));
37003
+ const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
37004
+ scope.addIdentifier(id);
37005
+ target.push(id);
36997
37006
  if (opt.getLastToken().getStr().toUpperCase() === "OPTIONAL") {
36998
37007
  const name = target[target.length - 1].getName().toUpperCase();
36999
37008
  this.optional.push(name);
@@ -39938,7 +39947,7 @@ class LSPLookup {
39938
39947
  const hover = "Type Definition, " + cursor.token.getStr() + "\n\n" + this.dumpType(type);
39939
39948
  return { hover, definition: found, definitionId: type, scope: bottomScope };
39940
39949
  }
39941
- const method = this.findMethodDefinition(cursor, bottomScope);
39950
+ const method = this.findMethodDefinition(cursor, bottomScope.getParent());
39942
39951
  if (method !== undefined && method.getStart().equals(cursor.token.getStart())) {
39943
39952
  const found = _lsp_utils_1.LSPUtils.identiferToLocation(method);
39944
39953
  const hover = "Method Definition \"" + method.getName() + "\"";
@@ -40155,6 +40164,9 @@ class LSPLookup {
40155
40164
  }
40156
40165
  static findMethodDefinition(found, scope) {
40157
40166
  var _a, _b, _c, _d;
40167
+ if (scope === undefined) {
40168
+ return undefined;
40169
+ }
40158
40170
  if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
40159
40171
  || !(found.snode.get() instanceof Statements.MethodDef)) {
40160
40172
  return undefined;
@@ -48557,7 +48569,7 @@ class Registry {
48557
48569
  }
48558
48570
  static abaplintVersion() {
48559
48571
  // magic, see build script "version.sh"
48560
- return "2.102.13";
48572
+ return "2.102.15";
48561
48573
  }
48562
48574
  getDDICReferences() {
48563
48575
  return this.ddicReferences;
@@ -53194,7 +53206,7 @@ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplin
53194
53206
  const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
53195
53207
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
53196
53208
  const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
53197
- const crypto = __webpack_require__(/*! node:crypto */ "node:crypto");
53209
+ const crypto = __webpack_require__(/*! crypto */ "crypto");
53198
53210
  // todo: refactor each sub-rule to new classes?
53199
53211
  // todo: add configuration
53200
53212
  class DownportConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -57285,6 +57297,7 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
57285
57297
  { name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
57286
57298
  { name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
57287
57299
  { name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
57300
+ { name: "QF05_RANDOM_INTEGER", replace: "use CL_ABAP_RANDOM_INT" },
57288
57301
  { name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
57289
57302
  { name: "ROUND", replace: "use built in function: round()" },
57290
57303
  { name: "SAPGUI_PROGRESS_INDICATOR", replace: "use CL_PROGRESS_INDICATOR" },
@@ -80934,6 +80947,17 @@ module.exports = require("child_process");
80934
80947
 
80935
80948
  /***/ }),
80936
80949
 
80950
+ /***/ "crypto":
80951
+ /*!*************************!*\
80952
+ !*** external "crypto" ***!
80953
+ \*************************/
80954
+ /***/ ((module) => {
80955
+
80956
+ "use strict";
80957
+ module.exports = require("crypto");
80958
+
80959
+ /***/ }),
80960
+
80937
80961
  /***/ "events":
80938
80962
  /*!*************************!*\
80939
80963
  !*** external "events" ***!
@@ -80956,17 +80980,6 @@ module.exports = require("fs");
80956
80980
 
80957
80981
  /***/ }),
80958
80982
 
80959
- /***/ "node:crypto":
80960
- /*!******************************!*\
80961
- !*** external "node:crypto" ***!
80962
- \******************************/
80963
- /***/ ((module) => {
80964
-
80965
- "use strict";
80966
- module.exports = require("node:crypto");
80967
-
80968
- /***/ }),
80969
-
80970
80983
  /***/ "node:os":
80971
80984
  /*!**************************!*\
80972
80985
  !*** external "node:os" ***!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.102.13",
3
+ "version": "2.102.15",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.102.13",
41
+ "@abaplint/core": "^2.102.15",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",
45
45
  "@types/mocha": "^10.0.1",
46
- "@types/node": "^20.4.5",
46
+ "@types/node": "^20.4.8",
47
47
  "@types/progress": "^2.0.5",
48
48
  "chai": "^4.3.7",
49
49
  "chalk": "^5.3.0",