@abaplint/core 2.113.14 → 2.113.16
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/registry.js
CHANGED
|
@@ -745,7 +745,7 @@ ${indentation}`);
|
|
|
745
745
|
return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
746
746
|
}
|
|
747
747
|
downportSelectTableInline(low, high, lowFile, highSyntax) {
|
|
748
|
-
var _a, _b, _c;
|
|
748
|
+
var _a, _b, _c, _d, _e;
|
|
749
749
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
750
750
|
return undefined;
|
|
751
751
|
}
|
|
@@ -771,17 +771,22 @@ ${indentation}`);
|
|
|
771
771
|
return undefined;
|
|
772
772
|
}
|
|
773
773
|
let fieldDefinitions = "";
|
|
774
|
-
for (const f of fieldList.findAllExpressions(Expressions.
|
|
775
|
-
let fieldName = f.concatTokens();
|
|
774
|
+
for (const f of fieldList.findAllExpressions(Expressions.SQLField)) {
|
|
775
|
+
let fieldName = (_c = f.findFirstExpression(Expressions.SQLFieldName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
776
|
+
if (fieldName === undefined) {
|
|
777
|
+
continue;
|
|
778
|
+
}
|
|
776
779
|
if (fieldName.includes("~")) {
|
|
777
780
|
const split = fieldName.split("~");
|
|
778
781
|
tableName = split[0];
|
|
779
782
|
fieldName = split[1];
|
|
780
783
|
}
|
|
781
|
-
|
|
784
|
+
const typeName = tableName + "-" + fieldName;
|
|
785
|
+
fieldName = ((_d = f.findFirstExpression(Expressions.SQLAsName)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || fieldName;
|
|
786
|
+
fieldDefinitions += indentation + " " + fieldName + " TYPE " + typeName + ",\n";
|
|
782
787
|
}
|
|
783
788
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
784
|
-
const name = ((
|
|
789
|
+
const name = ((_e = inlineData.findFirstExpression(Expressions.TargetField)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "error";
|
|
785
790
|
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
786
791
|
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
787
792
|
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
@@ -89,6 +89,7 @@ ENDCLASS.`,
|
|
|
89
89
|
};
|
|
90
90
|
const expected = new indent_1.Indent(indentOpts).getExpectedIndents(file);
|
|
91
91
|
const ret = [];
|
|
92
|
+
let previous = undefined;
|
|
92
93
|
for (const statement of file.getStatements()) {
|
|
93
94
|
const position = statement.getFirstToken().getStart();
|
|
94
95
|
if (position instanceof virtual_position_1.VirtualPosition) {
|
|
@@ -123,6 +124,12 @@ ENDCLASS.`,
|
|
|
123
124
|
continue;
|
|
124
125
|
}
|
|
125
126
|
}
|
|
127
|
+
// only apply for the first statement in a chain
|
|
128
|
+
if (statement.getColon() !== undefined
|
|
129
|
+
&& (previous === null || previous === void 0 ? void 0 : previous.getColon()) !== undefined
|
|
130
|
+
&& statement.getColon().getStart().equals(previous.getColon().getStart())) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
126
133
|
if (indent && indent > 0 && indent !== position.getCol()) {
|
|
127
134
|
const expected = indent - 1;
|
|
128
135
|
const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(position.getRow(), 1), position, " ".repeat(expected));
|
|
@@ -133,6 +140,7 @@ ENDCLASS.`,
|
|
|
133
140
|
break;
|
|
134
141
|
}
|
|
135
142
|
}
|
|
143
|
+
previous = statement;
|
|
136
144
|
}
|
|
137
145
|
return ret;
|
|
138
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.16",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@microsoft/api-extractor": "^7.47.9",
|
|
54
|
-
"@types/chai": "^4.3.
|
|
54
|
+
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.8",
|
|
56
|
-
"@types/node": "^22.7.
|
|
56
|
+
"@types/node": "^22.7.3",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"eslint": "^9.11.1",
|
|
59
59
|
"mocha": "^10.7.3",
|