@abaplint/cli 2.109.1 → 2.109.3
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.
- package/build/cli.js +34 -5
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -41676,6 +41676,7 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
|
|
|
41676
41676
|
const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
|
|
41677
41677
|
const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
|
|
41678
41678
|
const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
41679
|
+
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
41679
41680
|
class LSPLookup {
|
|
41680
41681
|
static lookup(cursor, reg, obj) {
|
|
41681
41682
|
var _a, _b;
|
|
@@ -41792,6 +41793,18 @@ class LSPLookup {
|
|
|
41792
41793
|
scope: bottomScope,
|
|
41793
41794
|
};
|
|
41794
41795
|
}
|
|
41796
|
+
if (cursor.snode.get() instanceof _statement_1.MacroCall) {
|
|
41797
|
+
const macroDefinition = reg.getMacroReferences().findDefinitionByUsage(cursor.identifier.getFilename(), cursor.snode.getFirstToken());
|
|
41798
|
+
if (macroDefinition) {
|
|
41799
|
+
return {
|
|
41800
|
+
hover: "Macro Call",
|
|
41801
|
+
definition: {
|
|
41802
|
+
uri: macroDefinition === null || macroDefinition === void 0 ? void 0 : macroDefinition.filename,
|
|
41803
|
+
range: _lsp_utils_1.LSPUtils.tokenToRange(macroDefinition.token),
|
|
41804
|
+
},
|
|
41805
|
+
};
|
|
41806
|
+
}
|
|
41807
|
+
}
|
|
41795
41808
|
if (hoverValue !== "") {
|
|
41796
41809
|
return { hover: hoverValue, scope: bottomScope };
|
|
41797
41810
|
}
|
|
@@ -43263,6 +43276,7 @@ class References {
|
|
|
43263
43276
|
const locs = this.search(lookup.definitionId, lookup.scope);
|
|
43264
43277
|
return locs.map(_lsp_utils_1.LSPUtils.identiferToLocation);
|
|
43265
43278
|
}
|
|
43279
|
+
////////////////////////////////////////////
|
|
43266
43280
|
// todo, cleanup this mehtod, some of the method parameters are not used anymore?
|
|
43267
43281
|
search(identifier, node, exitAfterFound = false, removeDuplicates = true) {
|
|
43268
43282
|
let ret = [];
|
|
@@ -43290,7 +43304,6 @@ class References {
|
|
|
43290
43304
|
return ret;
|
|
43291
43305
|
}
|
|
43292
43306
|
}
|
|
43293
|
-
////////////////////////////////////////////
|
|
43294
43307
|
removeDuplicates(arr) {
|
|
43295
43308
|
const values = {};
|
|
43296
43309
|
return arr.filter(item => {
|
|
@@ -43740,10 +43753,10 @@ class MacroReferences {
|
|
|
43740
43753
|
}
|
|
43741
43754
|
this.definitions[ref.filename].push({ token: ref.token, start, end });
|
|
43742
43755
|
}
|
|
43743
|
-
|
|
43756
|
+
getDefinitionRange(filename, token) {
|
|
43744
43757
|
for (const d of this.definitions[filename] || []) {
|
|
43745
43758
|
if (d.token.getStart().equals(token.getStart())) {
|
|
43746
|
-
return { start: d.
|
|
43759
|
+
return { start: d.start, end: d.end };
|
|
43747
43760
|
}
|
|
43748
43761
|
}
|
|
43749
43762
|
return undefined;
|
|
@@ -43775,6 +43788,22 @@ class MacroReferences {
|
|
|
43775
43788
|
delete this.definitions[filename];
|
|
43776
43789
|
delete this.references[filename];
|
|
43777
43790
|
}
|
|
43791
|
+
findDefinitionByUsage(filename, token) {
|
|
43792
|
+
const tokenStr = token.getStr().toUpperCase();
|
|
43793
|
+
for (const ref of this.references[filename] || []) {
|
|
43794
|
+
if (ref.token.getStart().equals(token.getStart())) {
|
|
43795
|
+
for (const d of this.definitions[ref.filename] || []) {
|
|
43796
|
+
if (d.token.getStr().toUpperCase() === tokenStr) {
|
|
43797
|
+
return {
|
|
43798
|
+
filename: ref.filename,
|
|
43799
|
+
token: d.token,
|
|
43800
|
+
};
|
|
43801
|
+
}
|
|
43802
|
+
}
|
|
43803
|
+
}
|
|
43804
|
+
}
|
|
43805
|
+
return undefined;
|
|
43806
|
+
}
|
|
43778
43807
|
}
|
|
43779
43808
|
exports.MacroReferences = MacroReferences;
|
|
43780
43809
|
//# sourceMappingURL=macro_references.js.map
|
|
@@ -51745,7 +51774,7 @@ class Registry {
|
|
|
51745
51774
|
}
|
|
51746
51775
|
static abaplintVersion() {
|
|
51747
51776
|
// magic, see build script "version.sh"
|
|
51748
|
-
return "2.109.
|
|
51777
|
+
return "2.109.3";
|
|
51749
51778
|
}
|
|
51750
51779
|
getDDICReferences() {
|
|
51751
51780
|
return this.ddicReferences;
|
|
@@ -72436,7 +72465,7 @@ foobar2.`,
|
|
|
72436
72465
|
const usages = references.listUsagesbyMacro(file.getFilename(), macroToken);
|
|
72437
72466
|
if (usages.length === 0 && ((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.includes(macroToken.getStr().toUpperCase())) === false) {
|
|
72438
72467
|
const message = "Unused macro definition: " + macroToken.getStr();
|
|
72439
|
-
const pos = references.
|
|
72468
|
+
const pos = references.getDefinitionRange(file.getFilename(), macroToken);
|
|
72440
72469
|
const fix = edit_helper_1.EditHelper.deleteRange(file, pos.start, pos.end);
|
|
72441
72470
|
result.push(issue_1.Issue.atToken(file, macroToken, message, this.getMetadata().key, this.conf.severity, fix));
|
|
72442
72471
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.109.
|
|
3
|
+
"version": "2.109.3",
|
|
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.109.
|
|
41
|
+
"@abaplint/core": "^2.109.3",
|
|
42
42
|
"@types/chai": "^4.3.16",
|
|
43
43
|
"@types/glob": "^8.1.0",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|