@abaplint/core 2.113.103 → 2.113.104
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/src/lsp/symbols.js +20 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/src/lsp/symbols.js
CHANGED
|
@@ -3,8 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Symbols = void 0;
|
|
4
4
|
/* eslint-disable max-len */
|
|
5
5
|
const LServer = require("vscode-languageserver-types");
|
|
6
|
+
const _identifier_1 = require("../abap/4_file_information/_identifier");
|
|
6
7
|
const _lsp_utils_1 = require("./_lsp_utils");
|
|
7
8
|
const statements_1 = require("../abap/2_statements/statements");
|
|
9
|
+
const Statements = require("../abap/2_statements/statements");
|
|
10
|
+
const Expressions = require("../abap/2_statements/expressions");
|
|
8
11
|
class Symbols {
|
|
9
12
|
constructor(reg) {
|
|
10
13
|
this.reg = reg;
|
|
@@ -17,6 +20,7 @@ class Symbols {
|
|
|
17
20
|
const ret = [];
|
|
18
21
|
ret.push(...this.outputClasses(file));
|
|
19
22
|
ret.push(...this.outputForms(file));
|
|
23
|
+
ret.push(...this.outputModules(file));
|
|
20
24
|
return ret;
|
|
21
25
|
}
|
|
22
26
|
selectionRange(identifier) {
|
|
@@ -57,6 +61,22 @@ class Symbols {
|
|
|
57
61
|
}
|
|
58
62
|
return ret;
|
|
59
63
|
}
|
|
64
|
+
outputModules(file) {
|
|
65
|
+
var _a;
|
|
66
|
+
const ret = [];
|
|
67
|
+
for (const statement of file.getStatements()) {
|
|
68
|
+
if (statement.get() instanceof Statements.Module) {
|
|
69
|
+
const nameToken = (_a = statement.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
70
|
+
if (nameToken === undefined) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const identifier = new _identifier_1.Identifier(nameToken, file.getFilename());
|
|
74
|
+
const symbol = this.newSymbol(identifier, LServer.SymbolKind.Module, []);
|
|
75
|
+
ret.push(symbol);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return ret;
|
|
79
|
+
}
|
|
60
80
|
outputClasses(file) {
|
|
61
81
|
const ret = [];
|
|
62
82
|
for (const cla of file.getInfo().listClassDefinitions()) {
|
package/build/src/registry.js
CHANGED