@abaplint/cli 2.113.12 → 2.113.13

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 +20 -3
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -52746,7 +52746,7 @@ class Registry {
52746
52746
  }
52747
52747
  static abaplintVersion() {
52748
52748
  // magic, see build script "version.sh"
52749
- return "2.113.12";
52749
+ return "2.113.13";
52750
52750
  }
52751
52751
  getDDICReferences() {
52752
52752
  return this.ddicReferences;
@@ -73986,7 +73986,7 @@ class UnusedMethods {
73986
73986
  extendedInformation: `Checks private and protected methods.
73987
73987
 
73988
73988
  Unused methods are not reported if the object contains parser or syntax errors.
73989
- Quick fixes only appears for private methods.
73989
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
73990
73990
 
73991
73991
  Skips:
73992
73992
  * methods FOR TESTING
@@ -74079,7 +74079,8 @@ Skips:
74079
74079
  continue;
74080
74080
  }
74081
74081
  let fix = undefined;
74082
- if (i.visibility === visibility_1.Visibility.Private) {
74082
+ if (i.visibility === visibility_1.Visibility.Private
74083
+ || (i.visibility === visibility_1.Visibility.Protected && this.hasSubClass(obj) === false)) {
74083
74084
  const implementation = this.findMethodImplementation(i, file);
74084
74085
  if (implementation !== undefined) {
74085
74086
  const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
@@ -74092,6 +74093,22 @@ Skips:
74092
74093
  }
74093
74094
  return issues;
74094
74095
  }
74096
+ hasSubClass(obj) {
74097
+ var _a, _b, _c;
74098
+ if (!(obj instanceof objects_1.Class)) {
74099
+ return false;
74100
+ }
74101
+ if (((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.isFinal()) === true) {
74102
+ return false;
74103
+ }
74104
+ for (const r of this.reg.getObjects()) {
74105
+ if (r instanceof objects_1.Class
74106
+ && ((_c = (_b = r.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === obj.getName().toUpperCase()) {
74107
+ return true;
74108
+ }
74109
+ }
74110
+ return false;
74111
+ }
74095
74112
  findMethodImplementation(method, file) {
74096
74113
  var _a, _b;
74097
74114
  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.13",
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.13",
42
42
  "@types/chai": "^4.3.19",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",