@abaplint/transpiler-cli 2.7.63 → 2.7.65

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/bundle.js +32 -11
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -20477,6 +20477,7 @@ var ScopeType;
20477
20477
  ScopeType["FunctionModule"] = "function";
20478
20478
  ScopeType["Method"] = "method";
20479
20479
  ScopeType["MethodInstance"] = "method_instance";
20480
+ ScopeType["MethodDefinition"] = "method_definition";
20480
20481
  ScopeType["For"] = "for";
20481
20482
  ScopeType["Let"] = "let";
20482
20483
  ScopeType["OpenSQL"] = "open_sql";
@@ -28161,7 +28162,7 @@ class IncludeType {
28161
28162
  const components = [];
28162
28163
  for (const c of ityp.getComponents()) {
28163
28164
  if (c.name === as) {
28164
- components.push(c);
28165
+ components.push(Object.assign(Object.assign({}, c), { renamingSuffix: suffix }));
28165
28166
  continue;
28166
28167
  }
28167
28168
  components.push({
@@ -28636,11 +28637,12 @@ class MethodImplementation {
28636
28637
  if (methodDefinition === undefined) {
28637
28638
  throw new Error("Method definition \"" + methodName + "\" not found");
28638
28639
  }
28640
+ const start = node.getFirstToken().getStart();
28639
28641
  if (methodDefinition.isStatic() === false) {
28640
- scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, node.getFirstToken().getStart(), filename);
28642
+ scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, start, filename);
28641
28643
  scope.addList(classDefinition.getAttributes().getInstance());
28642
28644
  }
28643
- scope.push(_scope_type_1.ScopeType.Method, methodName, node.getFirstToken().getStart(), filename);
28645
+ scope.push(_scope_type_1.ScopeType.Method, methodName, start, filename);
28644
28646
  scope.addReference(methodToken, methodDefinition, _reference_1.ReferenceType.MethodImplementationReference, filename);
28645
28647
  scope.addList(methodDefinition.getParameters().getAll());
28646
28648
  for (const i of helper.findInterfaces(classDefinition)) {
@@ -35840,6 +35842,7 @@ const method_param_1 = __webpack_require__(/*! ../5_syntax/expressions/method_pa
35840
35842
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
35841
35843
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
35842
35844
  const identifier_1 = __webpack_require__(/*! ../1_lexer/tokens/identifier */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/identifier.js");
35845
+ const _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
35843
35846
  // todo:
35844
35847
  // this.exceptions = [];
35845
35848
  // also consider RAISING vs EXCEPTIONS
@@ -35857,7 +35860,11 @@ class MethodParameters {
35857
35860
  this.preferred = undefined;
35858
35861
  this.exceptions = [];
35859
35862
  this.filename = filename;
35860
- this.parse(node, scope, filename);
35863
+ // need the scope for LIKE typing inside method parameters
35864
+ const parentName = scope.getName();
35865
+ scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), filename);
35866
+ this.parse(node, scope, filename, parentName);
35867
+ scope.pop(node.getEnd());
35861
35868
  }
35862
35869
  getFilename() {
35863
35870
  return this.filename;
@@ -35932,7 +35939,7 @@ class MethodParameters {
35932
35939
  return this.defaults[parameter.toUpperCase()];
35933
35940
  }
35934
35941
  ///////////////////
35935
- parse(node, scope, filename) {
35942
+ parse(node, scope, filename, parentName) {
35936
35943
  var _a, _b;
35937
35944
  const handler = node.findFirstExpression(Expressions.EventHandler);
35938
35945
  if (handler) {
@@ -35992,9 +35999,9 @@ class MethodParameters {
35992
35999
  if (returning) {
35993
36000
  this.returning = new method_def_returning_1.MethodDefReturning().runSyntax(returning, scope, this.filename, ["returning" /* IdentifierMeta.MethodReturning */]);
35994
36001
  }
35995
- this.workaroundRAP(node, scope, filename);
36002
+ this.workaroundRAP(node, scope, filename, parentName);
35996
36003
  }
35997
- workaroundRAP(node, scope, filename) {
36004
+ workaroundRAP(node, _scope, filename, parentName) {
35998
36005
  const resultName = node.findExpressionAfterToken("RESULT");
35999
36006
  const isRap = node.findExpressionAfterToken("IMPORTING");
36000
36007
  if (isRap) {
@@ -36019,7 +36026,7 @@ class MethodParameters {
36019
36026
  this.importing.push(new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
36020
36027
  }
36021
36028
  // its some kind of magic
36022
- if (scope.getName().toUpperCase() === "CL_ABAP_BEHAVIOR_SAVER") {
36029
+ if (parentName.toUpperCase() === "CL_ABAP_BEHAVIOR_SAVER") {
36023
36030
  const tempChanging = this.changing.map(c => new _typed_identifier_1.TypedIdentifier(c.getToken(), filename, new basic_1.VoidType("RapMethodParameter"), c.getMeta()));
36024
36031
  while (this.changing.length > 0) {
36025
36032
  this.changing.shift();
@@ -36046,7 +36053,9 @@ class MethodParameters {
36046
36053
  else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
36047
36054
  extraMeta.push("read_only" /* IdentifierMeta.ReadOnly */);
36048
36055
  }
36049
- target.push(new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]));
36056
+ const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
36057
+ scope.addIdentifier(id);
36058
+ target.push(id);
36050
36059
  if (opt.getLastToken().getStr().toUpperCase() === "OPTIONAL") {
36051
36060
  const name = target[target.length - 1].getName().toUpperCase();
36052
36061
  this.optional.push(name);
@@ -38991,7 +39000,7 @@ class LSPLookup {
38991
39000
  const hover = "Type Definition, " + cursor.token.getStr() + "\n\n" + this.dumpType(type);
38992
39001
  return { hover, definition: found, definitionId: type, scope: bottomScope };
38993
39002
  }
38994
- const method = this.findMethodDefinition(cursor, bottomScope);
39003
+ const method = this.findMethodDefinition(cursor, bottomScope.getParent());
38995
39004
  if (method !== undefined && method.getStart().equals(cursor.token.getStart())) {
38996
39005
  const found = _lsp_utils_1.LSPUtils.identiferToLocation(method);
38997
39006
  const hover = "Method Definition \"" + method.getName() + "\"";
@@ -39208,6 +39217,9 @@ class LSPLookup {
39208
39217
  }
39209
39218
  static findMethodDefinition(found, scope) {
39210
39219
  var _a, _b, _c, _d;
39220
+ if (scope === undefined) {
39221
+ return undefined;
39222
+ }
39211
39223
  if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
39212
39224
  || !(found.snode.get() instanceof Statements.MethodDef)) {
39213
39225
  return undefined;
@@ -47610,7 +47622,7 @@ class Registry {
47610
47622
  }
47611
47623
  static abaplintVersion() {
47612
47624
  // magic, see build script "version.sh"
47613
- return "2.102.14";
47625
+ return "2.102.15";
47614
47626
  }
47615
47627
  getDDICReferences() {
47616
47628
  return this.ddicReferences;
@@ -56338,6 +56350,7 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
56338
56350
  { name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
56339
56351
  { name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
56340
56352
  { name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
56353
+ { name: "QF05_RANDOM_INTEGER", replace: "use CL_ABAP_RANDOM_INT" },
56341
56354
  { name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
56342
56355
  { name: "ROUND", replace: "use built in function: round()" },
56343
56356
  { name: "SAPGUI_PROGRESS_INDICATOR", replace: "use CL_PROGRESS_INDICATOR" },
@@ -79937,8 +79950,12 @@ class TranspileTypes {
79937
79950
  else if (type instanceof abaplint.BasicTypes.StructureType) {
79938
79951
  resolved = "Structure";
79939
79952
  const list = [];
79953
+ const renamingSuffix = {};
79940
79954
  for (const c of type.getComponents()) {
79941
79955
  list.push(`"` + c.name.toLowerCase() + `": ` + this.toType(c.type));
79956
+ if (c.renamingSuffix) {
79957
+ renamingSuffix[c.name.toLowerCase()] = c.renamingSuffix;
79958
+ }
79942
79959
  }
79943
79960
  extra = "{" + list.join(", ") + "}";
79944
79961
  if (type.getQualifiedName() !== undefined) {
@@ -79950,6 +79967,10 @@ class TranspileTypes {
79950
79967
  if (type.getDDICName() !== undefined) {
79951
79968
  extra += ", \"" + type.getQualifiedName() + "\"";
79952
79969
  }
79970
+ else {
79971
+ extra += ", undefined";
79972
+ }
79973
+ extra += ", " + JSON.stringify(renamingSuffix);
79953
79974
  }
79954
79975
  else if (type instanceof abaplint.BasicTypes.CLikeType
79955
79976
  || type instanceof abaplint.BasicTypes.CGenericType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.63",
3
+ "version": "2.7.65",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.63",
29
+ "@abaplint/transpiler": "^2.7.65",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
- "@types/node": "^20.4.7",
34
- "@abaplint/core": "^2.102.14",
33
+ "@types/node": "^20.4.8",
34
+ "@abaplint/core": "^2.102.15",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",
37
37
  "webpack-cli": "^5.1.4",