@abaplint/cli 2.113.12 → 2.113.14

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 +22 -3
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -20038,6 +20038,7 @@ class ABAPFileInformation {
20038
20038
  identifier: new _identifier_1.Identifier(methodName, this.filename),
20039
20039
  isRedefinition: def.findDirectExpression(Expressions.Redefinition) !== undefined,
20040
20040
  isForTesting: def.concatTokens().toUpperCase().includes(" FOR TESTING"),
20041
+ isFinal: def.concatTokens().toUpperCase().includes(" FINAL"),
20041
20042
  isAbstract: def.findDirectExpression(Expressions.Abstract) !== undefined,
20042
20043
  isEventHandler: def.findDirectExpression(Expressions.EventHandler) !== undefined,
20043
20044
  visibility,
@@ -52746,7 +52747,7 @@ class Registry {
52746
52747
  }
52747
52748
  static abaplintVersion() {
52748
52749
  // magic, see build script "version.sh"
52749
- return "2.113.12";
52750
+ return "2.113.14";
52750
52751
  }
52751
52752
  getDDICReferences() {
52752
52753
  return this.ddicReferences;
@@ -73986,7 +73987,7 @@ class UnusedMethods {
73986
73987
  extendedInformation: `Checks private and protected methods.
73987
73988
 
73988
73989
  Unused methods are not reported if the object contains parser or syntax errors.
73989
- Quick fixes only appears for private methods.
73990
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
73990
73991
 
73991
73992
  Skips:
73992
73993
  * methods FOR TESTING
@@ -74079,7 +74080,9 @@ Skips:
74079
74080
  continue;
74080
74081
  }
74081
74082
  let fix = undefined;
74082
- if (i.visibility === visibility_1.Visibility.Private) {
74083
+ if (i.visibility === visibility_1.Visibility.Private
74084
+ || i.isFinal === true
74085
+ || (i.visibility === visibility_1.Visibility.Protected && this.hasSubClass(obj) === false)) {
74083
74086
  const implementation = this.findMethodImplementation(i, file);
74084
74087
  if (implementation !== undefined) {
74085
74088
  const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
@@ -74092,6 +74095,22 @@ Skips:
74092
74095
  }
74093
74096
  return issues;
74094
74097
  }
74098
+ hasSubClass(obj) {
74099
+ var _a, _b, _c;
74100
+ if (!(obj instanceof objects_1.Class)) {
74101
+ return false;
74102
+ }
74103
+ if (((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.isFinal()) === true) {
74104
+ return false;
74105
+ }
74106
+ for (const r of this.reg.getObjects()) {
74107
+ if (r instanceof objects_1.Class
74108
+ && ((_c = (_b = r.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === obj.getName().toUpperCase()) {
74109
+ return true;
74110
+ }
74111
+ }
74112
+ return false;
74113
+ }
74095
74114
  findMethodImplementation(method, file) {
74096
74115
  var _a, _b;
74097
74116
  for (const classImplementation of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStructures(Structures.ClassImplementation)) || []) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.12",
3
+ "version": "2.113.14",
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.113.12",
41
+ "@abaplint/core": "^2.113.14",
42
42
  "@types/chai": "^4.3.19",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",