@abaplint/core 2.113.39 → 2.113.40
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/abap/2_statements/statements/data_begin.js +2 -1
- package/build/src/abap/flow/statement_flow.js +9 -1
- package/build/src/cds/cds_determine_types.js +12 -2
- package/build/src/cds/expressions/cds_cast.js +1 -1
- package/build/src/lsp/help.js +16 -4
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ const expressions_1 = require("../expressions");
|
|
|
6
6
|
class DataBegin {
|
|
7
7
|
getMatcher() {
|
|
8
8
|
const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Integer);
|
|
9
|
-
const
|
|
9
|
+
const common = (0, combi_1.altPrio)((0, combi_1.seq)("COMMON PART", expressions_1.DefinitionName), "COMMON PART");
|
|
10
|
+
const structure = (0, combi_1.seq)("BEGIN OF", (0, combi_1.altPrio)(common, (0, combi_1.seq)(expressions_1.DefinitionName, (0, combi_1.opt)("READ-ONLY"), (0, combi_1.opt)(occurs))));
|
|
10
11
|
return (0, combi_1.seq)("DATA", structure);
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -8,6 +8,7 @@ const Expressions = require("../2_statements/expressions");
|
|
|
8
8
|
const flow_graph_1 = require("./flow_graph");
|
|
9
9
|
const objects_1 = require("../../objects");
|
|
10
10
|
const selection_events_1 = require("./selection_events");
|
|
11
|
+
const virtual_position_1 = require("../../virtual_position");
|
|
11
12
|
class StatementFlow {
|
|
12
13
|
constructor() {
|
|
13
14
|
this.counter = 0;
|
|
@@ -96,6 +97,7 @@ class StatementFlow {
|
|
|
96
97
|
var _a;
|
|
97
98
|
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
|
98
99
|
}
|
|
100
|
+
// note: it must handle macros and chained statements
|
|
99
101
|
buildName(statement) {
|
|
100
102
|
let token = undefined;
|
|
101
103
|
const colon = statement.getColon();
|
|
@@ -110,12 +112,18 @@ class StatementFlow {
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
}
|
|
115
|
+
let extra = "";
|
|
116
|
+
const tStart = token === null || token === void 0 ? void 0 : token.getStart();
|
|
117
|
+
if (tStart instanceof virtual_position_1.VirtualPosition) {
|
|
118
|
+
extra += "$" + tStart.vrow;
|
|
119
|
+
extra += "," + tStart.vcol;
|
|
120
|
+
}
|
|
113
121
|
if (token === undefined) {
|
|
114
122
|
return "tokenError";
|
|
115
123
|
}
|
|
116
124
|
return statement.get().constructor.name +
|
|
117
125
|
":" + token.getRow() +
|
|
118
|
-
"," + token.getCol();
|
|
126
|
+
"," + token.getCol() + extra;
|
|
119
127
|
}
|
|
120
128
|
traverseBody(children, context) {
|
|
121
129
|
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
@@ -13,9 +13,19 @@ class CDSDetermineTypes {
|
|
|
13
13
|
const components = [];
|
|
14
14
|
for (const f of (parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields) || []) {
|
|
15
15
|
if (f.prefix !== "") {
|
|
16
|
-
|
|
16
|
+
const prefixUpper = f.prefix.toUpperCase();
|
|
17
|
+
let source = parsedData.sources.find((s) => { var _a; return ((_a = s.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === prefixUpper; });
|
|
17
18
|
if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
|
|
18
|
-
source = parsedData.sources.find((s) => s.name.toUpperCase() ===
|
|
19
|
+
source = parsedData.sources.find((s) => s.name.toUpperCase() === prefixUpper);
|
|
20
|
+
}
|
|
21
|
+
if ((source === null || source === void 0 ? void 0 : source.name) === undefined
|
|
22
|
+
&& (parsedData.associations.find((s) => s.name.toUpperCase() === prefixUpper)
|
|
23
|
+
|| parsedData.associations.find((s) => { var _a; return ((_a = s.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === prefixUpper; }))) {
|
|
24
|
+
components.push({
|
|
25
|
+
name: f.name,
|
|
26
|
+
type: new basic_1.VoidType("DDLS:association"),
|
|
27
|
+
});
|
|
28
|
+
continue;
|
|
19
29
|
}
|
|
20
30
|
if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
|
|
21
31
|
components.push({
|
|
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
class CDSCast extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
|
|
9
|
-
return (0, combi_1.seq)("CAST", "(", (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSCase, CDSCast, _1.CDSString, _1.CDSArithmetics), "AS", _1.CDSType, (0, combi_1.opt)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
|
|
9
|
+
return (0, combi_1.seq)("CAST", "(", (0, combi_1.alt)(name, _1.CDSFunction, _1.CDSCase, _1.CDSAggregate, CDSCast, _1.CDSString, _1.CDSArithmetics), "AS", _1.CDSType, (0, combi_1.opt)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.CDSCast = CDSCast;
|
package/build/src/lsp/help.js
CHANGED
|
@@ -6,6 +6,7 @@ const _lsp_utils_1 = require("./_lsp_utils");
|
|
|
6
6
|
const syntax_1 = require("../abap/5_syntax/syntax");
|
|
7
7
|
const _abap_object_1 = require("../objects/_abap_object");
|
|
8
8
|
const dump_scope_1 = require("./dump_scope");
|
|
9
|
+
const virtual_position_1 = require("../virtual_position");
|
|
9
10
|
class Help {
|
|
10
11
|
static find(reg, textDocument, position) {
|
|
11
12
|
const file = _lsp_utils_1.LSPUtils.getABAPFile(reg, textDocument.uri);
|
|
@@ -180,13 +181,24 @@ class Help {
|
|
|
180
181
|
return ret + "</ul>";
|
|
181
182
|
}
|
|
182
183
|
static tokens(file) {
|
|
183
|
-
let inner =
|
|
184
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
185
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
186
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
187
|
+
</tr>`;
|
|
184
188
|
for (const token of file.getTokens()) {
|
|
185
|
-
|
|
189
|
+
const tStart = token.getStart();
|
|
190
|
+
inner += "<tr><td><tt>" +
|
|
186
191
|
this.escape(token.getStr()) + "</tt></td><td>" +
|
|
187
192
|
token.constructor.name + "</td><td align=\"right\">" +
|
|
188
|
-
|
|
189
|
-
|
|
193
|
+
tStart.getRow() + "</td><td align=\"right\">" +
|
|
194
|
+
tStart.getCol() + "</td>";
|
|
195
|
+
if (tStart instanceof virtual_position_1.VirtualPosition) {
|
|
196
|
+
inner += `<td>${tStart.vcol}</td><td>${tStart.vrow}</td>`;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
inner += "<td></td><td></td>";
|
|
200
|
+
}
|
|
201
|
+
inner += "</tr>";
|
|
190
202
|
}
|
|
191
203
|
inner = inner + "</table>";
|
|
192
204
|
return inner;
|
package/build/src/registry.js
CHANGED