@abaplint/cli 2.101.32 → 2.101.33
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 +35 -1
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -48465,7 +48465,7 @@ class Registry {
|
|
|
48465
48465
|
}
|
|
48466
48466
|
static abaplintVersion() {
|
|
48467
48467
|
// magic, see build script "version.sh"
|
|
48468
|
-
return "2.101.
|
|
48468
|
+
return "2.101.33";
|
|
48469
48469
|
}
|
|
48470
48470
|
getDDICReferences() {
|
|
48471
48471
|
return this.ddicReferences;
|
|
@@ -53465,6 +53465,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
53465
53465
|
if (found) {
|
|
53466
53466
|
return found;
|
|
53467
53467
|
}
|
|
53468
|
+
found = this.downportSelectExistence(low, high, lowFile, highSyntax);
|
|
53469
|
+
if (found) {
|
|
53470
|
+
return found;
|
|
53471
|
+
}
|
|
53468
53472
|
found = this.downportSQLExtras(low, high, lowFile, highSyntax);
|
|
53469
53473
|
if (found) {
|
|
53470
53474
|
return found;
|
|
@@ -53594,6 +53598,7 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
53594
53598
|
return undefined;
|
|
53595
53599
|
}
|
|
53596
53600
|
//////////////////////////////////////////
|
|
53601
|
+
/** removes @'s */
|
|
53597
53602
|
downportSQLExtras(low, high, lowFile, highSyntax) {
|
|
53598
53603
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
53599
53604
|
return undefined;
|
|
@@ -53666,6 +53671,35 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
53666
53671
|
}
|
|
53667
53672
|
return undefined;
|
|
53668
53673
|
}
|
|
53674
|
+
downportSelectExistence(low, high, lowFile, highSyntax) {
|
|
53675
|
+
var _a, _b, _c, _d;
|
|
53676
|
+
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
53677
|
+
return undefined;
|
|
53678
|
+
}
|
|
53679
|
+
else if (!(high.get() instanceof Statements.Select)) {
|
|
53680
|
+
return undefined;
|
|
53681
|
+
}
|
|
53682
|
+
const fieldList = high.findFirstExpression(Expressions.SQLFieldList);
|
|
53683
|
+
if ((fieldList === null || fieldList === void 0 ? void 0 : fieldList.concatTokens().toUpperCase()) !== "@ABAP_TRUE") {
|
|
53684
|
+
return undefined;
|
|
53685
|
+
}
|
|
53686
|
+
const fieldName = (_b = (_a = high.findFirstExpression(Expressions.SQLCond)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.SQLFieldName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
53687
|
+
if (fieldName === undefined) {
|
|
53688
|
+
return undefined;
|
|
53689
|
+
}
|
|
53690
|
+
const into = high.findFirstExpression(Expressions.SQLIntoStructure);
|
|
53691
|
+
if (into === undefined) {
|
|
53692
|
+
return undefined;
|
|
53693
|
+
}
|
|
53694
|
+
const intoName = (_d = (_c = into.findFirstExpression(Expressions.SQLTarget)) === null || _c === void 0 ? void 0 : _c.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();
|
|
53695
|
+
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
53696
|
+
const fix1 = edit_helper_1.EditHelper.replaceRange(lowFile, fieldList.getFirstToken().getStart(), fieldList.getLastToken().getEnd(), fieldName);
|
|
53697
|
+
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, into === null || into === void 0 ? void 0 : into.getFirstToken().getStart(), into === null || into === void 0 ? void 0 : into.getLastToken().getEnd(), `INTO @DATA(${uniqueName})`);
|
|
53698
|
+
let fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
53699
|
+
const fix3 = edit_helper_1.EditHelper.insertAt(lowFile, high.getLastToken().getEnd(), `\nCLEAR ${intoName}.\nIF sy-subrc = 0.\n ${intoName} = abap_true\nENDIF.`);
|
|
53700
|
+
fix = edit_helper_1.EditHelper.merge(fix, fix3);
|
|
53701
|
+
return issue_1.Issue.atToken(lowFile, low.getFirstToken(), "SQL, refactor existence check", this.getMetadata().key, this.conf.severity, fix);
|
|
53702
|
+
}
|
|
53669
53703
|
downportSelectInline(low, high, lowFile, highSyntax) {
|
|
53670
53704
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
53671
53705
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.33",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.101.
|
|
41
|
+
"@abaplint/core": "^2.101.33",
|
|
42
42
|
"@types/chai": "^4.3.5",
|
|
43
43
|
"@types/glob": "^7.2.0",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|
|
45
45
|
"@types/mocha": "^10.0.1",
|
|
46
|
-
"@types/node": "^20.4.
|
|
46
|
+
"@types/node": "^20.4.1",
|
|
47
47
|
"@types/progress": "^2.0.5",
|
|
48
48
|
"chai": "^4.3.7",
|
|
49
49
|
"chalk": "^5.3.0",
|