@abaplint/core 2.113.5 → 2.113.6
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/_lookup.js +13 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/src/lsp/_lookup.js
CHANGED
|
@@ -11,8 +11,10 @@ const _typed_identifier_1 = require("../abap/types/_typed_identifier");
|
|
|
11
11
|
const _reference_1 = require("../abap/5_syntax/_reference");
|
|
12
12
|
const _builtin_1 = require("../abap/5_syntax/_builtin");
|
|
13
13
|
const _scope_type_1 = require("../abap/5_syntax/_scope_type");
|
|
14
|
+
const objects_1 = require("../objects");
|
|
14
15
|
const types_1 = require("../abap/types");
|
|
15
16
|
const _statement_1 = require("../abap/2_statements/statements/_statement");
|
|
17
|
+
const include_graph_1 = require("../utils/include_graph");
|
|
16
18
|
class LSPLookup {
|
|
17
19
|
static lookup(cursor, reg, obj) {
|
|
18
20
|
var _a, _b;
|
|
@@ -25,7 +27,17 @@ class LSPLookup {
|
|
|
25
27
|
if (fm) {
|
|
26
28
|
return { hover: "Function Module " + fm };
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
let main = obj;
|
|
31
|
+
if (obj instanceof objects_1.Program && obj.isInclude()) {
|
|
32
|
+
// todo: this is slow
|
|
33
|
+
const ig = new include_graph_1.IncludeGraph(reg);
|
|
34
|
+
const mains = ig.listMainForInclude(cursor.identifier.getFilename());
|
|
35
|
+
if (mains.length === 1) {
|
|
36
|
+
// yea, well, or it has to be a popup
|
|
37
|
+
main = reg.findObjectForFile(reg.getFileByName(mains[0])) || obj;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const bottomScope = new syntax_1.SyntaxLogic(reg, main).run().spaghetti.lookupPosition(cursor.identifier.getStart(), cursor.identifier.getFilename());
|
|
29
41
|
if (bottomScope === undefined) {
|
|
30
42
|
return undefined;
|
|
31
43
|
}
|
package/build/src/registry.js
CHANGED