@abaplint/core 2.113.138 → 2.113.140

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.
@@ -80,12 +80,14 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
80
80
  }
81
81
  if ((i.startsWith("L") || namespaced) && f.getFilename().includes(search.toLowerCase() + ".")) {
82
82
  ret.push({ file: f, name: i });
83
+ break;
83
84
  }
84
85
  // fix for URL encoded? Uris
85
86
  if (namespaced) {
86
87
  search = i.replace(/\//g, "%23");
87
88
  if (f.getFilename().includes(search.toLowerCase() + ".")) {
88
89
  ret.push({ file: f, name: i });
90
+ break;
89
91
  }
90
92
  }
91
93
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.138";
70
+ return "2.113.140";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -72,8 +72,9 @@ class RulesRunner {
72
72
  }
73
73
  (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, "Initialize Rules");
74
74
  for (const rule of rules) {
75
+ const start = Date.now();
75
76
  if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
76
- process.stderr.write("Initializing rule " + rule.getMetadata().key + "\n");
77
+ process.stderr.write("Initializing rule " + rule.getMetadata().key);
77
78
  }
78
79
  else {
79
80
  (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick("Initialize Rules - " + rule.getMetadata().key);
@@ -82,6 +83,9 @@ class RulesRunner {
82
83
  throw new Error(rule.getMetadata().key + " missing initialize method");
83
84
  }
84
85
  rule.initialize(this.reg);
86
+ if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
87
+ process.stderr.write(", " + (Date.now() - start) + "ms\n");
88
+ }
85
89
  rulePerformance[rule.getMetadata().key] = 0;
86
90
  }
87
91
  (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, "Finding Issues");
@@ -28,7 +28,9 @@ class Graph {
28
28
  this.edges = {};
29
29
  }
30
30
  addVertex(vertex) {
31
- this.verticesIncludenameIndex[vertex.includeName.toUpperCase()] = vertex;
31
+ if (vertex.includeName !== undefined) {
32
+ this.verticesIncludenameIndex[vertex.includeName.toUpperCase()] = vertex;
33
+ }
32
34
  this.verticesFilenameIndex[vertex.filename.toUpperCase()] = vertex;
33
35
  }
34
36
  findVertexViaIncludename(includeName) {
@@ -64,9 +66,6 @@ class IncludeGraph {
64
66
  this.graph = new Graph();
65
67
  this.build();
66
68
  }
67
- getIssues() {
68
- return this.issues;
69
- }
70
69
  listMainForInclude(filename) {
71
70
  const ret = [];
72
71
  if (filename === undefined) {
@@ -86,6 +85,17 @@ class IncludeGraph {
86
85
  ret.push(i);
87
86
  }
88
87
  }
88
+ const v = this.graph.findVertexByFilename(file.getFilename());
89
+ if (v !== undefined
90
+ && v.include === true
91
+ && this.listMainForInclude(v.filename).length === 0) {
92
+ const f = this.reg.getFileByName(v.filename);
93
+ if (f === undefined) {
94
+ throw new Error("findUnusedIncludes internal error");
95
+ }
96
+ const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
97
+ ret.push(issue);
98
+ }
89
99
  return ret;
90
100
  }
91
101
  ///////////////////////////////
@@ -126,21 +136,6 @@ class IncludeGraph {
126
136
  }
127
137
  }
128
138
  }
129
- this.findUnusedIncludes();
130
- }
131
- findUnusedIncludes() {
132
- for (const v of Object.values(this.graph.verticesFilenameIndex)) {
133
- if (v.include === true) {
134
- if (this.listMainForInclude(v.filename).length === 0) {
135
- const f = this.reg.getFileByName(v.filename);
136
- if (f === undefined) {
137
- throw new Error("findUnusedIncludes internal error");
138
- }
139
- const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
140
- this.issues.push(issue);
141
- }
142
- }
143
- }
144
139
  }
145
140
  addVertices() {
146
141
  for (const o of getABAPObjects(this.reg)) {
@@ -159,7 +154,7 @@ class IncludeGraph {
159
154
  if (file) {
160
155
  this.graph.addVertex({
161
156
  filename: file.getFilename(),
162
- includeName: o.getName(),
157
+ includeName: undefined,
163
158
  include: false
164
159
  });
165
160
  }
@@ -168,7 +163,7 @@ class IncludeGraph {
168
163
  for (const f of o.getSequencedFiles()) {
169
164
  this.graph.addVertex({
170
165
  filename: f.getFilename(),
171
- includeName: o.getName(),
166
+ includeName: undefined,
172
167
  include: false
173
168
  });
174
169
  }
@@ -185,7 +180,7 @@ class IncludeGraph {
185
180
  if (file) {
186
181
  this.graph.addVertex({
187
182
  filename: file.getFilename(),
188
- includeName: o.getName(),
183
+ includeName: undefined, // this is the SAPL program
189
184
  include: false
190
185
  });
191
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.138",
3
+ "version": "2.113.140",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -53,7 +53,7 @@
53
53
  "@microsoft/api-extractor": "^7.52.8",
54
54
  "@types/chai": "^4.3.20",
55
55
  "@types/mocha": "^10.0.10",
56
- "@types/node": "^24.0.10",
56
+ "@types/node": "^24.0.12",
57
57
  "chai": "^4.5.0",
58
58
  "eslint": "^9.30.1",
59
59
  "mocha": "^11.7.1",