@abaplint/core 2.117.0 → 2.117.1
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/abaplint.d.ts +3 -0
- package/build/src/abap/2_statements/expressions/sql_into_list.js +2 -1
- package/build/src/abap/5_syntax/expressions/sql_compare.js +7 -7
- package/build/src/objects/_dynpros.js +10 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/dynpro_checks.js +35 -1
- package/package.json +3 -3
package/build/abaplint.d.ts
CHANGED
|
@@ -5,9 +5,10 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const wparen_leftw_1 = require("../../1_lexer/tokens/wparen_leftw");
|
|
7
7
|
const wparen_left_1 = require("../../1_lexer/tokens/wparen_left");
|
|
8
|
+
const version_1 = require("../../../version");
|
|
8
9
|
class SQLIntoList extends combi_1.Expression {
|
|
9
10
|
getRunnable() {
|
|
10
|
-
const intoList = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.tok)(wparen_left_1.WParenLeft), (0, combi_1.tok)(wparen_leftw_1.WParenLeftW)), (0, combi_1.starPrio)((0, combi_1.seq)(_1.SQLTarget, ",")), _1.SQLTarget, ")");
|
|
11
|
+
const intoList = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.tok)(wparen_left_1.WParenLeft), (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.tok)(wparen_leftw_1.WParenLeftW))), (0, combi_1.starPrio)((0, combi_1.seq)(_1.SQLTarget, ",")), _1.SQLTarget, ")");
|
|
11
12
|
return (0, combi_1.seq)("INTO", intoList);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -33,36 +33,36 @@ class SQLCompare {
|
|
|
33
33
|
if (sqlin) {
|
|
34
34
|
sql_in_1.SQLIn.runSyntax(sqlin, input);
|
|
35
35
|
}
|
|
36
|
-
const fieldName = (_b = node.findDirectExpression(Expressions.SQLFieldName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
36
|
+
const fieldName = (_b = node.findDirectExpression(Expressions.SQLFieldName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();
|
|
37
37
|
if (fieldName && sourceType && token) {
|
|
38
38
|
// check compatibility for rule sql_value_conversion
|
|
39
39
|
const targetType = this.findType(fieldName, tables, input.scope);
|
|
40
40
|
let message = "";
|
|
41
41
|
if (sourceType instanceof basic_1.IntegerType
|
|
42
42
|
&& targetType instanceof basic_1.CharacterType) {
|
|
43
|
-
message =
|
|
43
|
+
message = `${fieldName}: Integer to CHAR conversion`;
|
|
44
44
|
}
|
|
45
45
|
else if (sourceType instanceof basic_1.IntegerType
|
|
46
46
|
&& targetType instanceof basic_1.NumericType) {
|
|
47
|
-
message =
|
|
47
|
+
message = `${fieldName}: Integer to NUMC conversion`;
|
|
48
48
|
}
|
|
49
49
|
else if (sourceType instanceof basic_1.NumericType
|
|
50
50
|
&& targetType instanceof basic_1.IntegerType) {
|
|
51
|
-
message =
|
|
51
|
+
message = `${fieldName}: NUMC to Integer conversion`;
|
|
52
52
|
}
|
|
53
53
|
else if (sourceType instanceof basic_1.CharacterType
|
|
54
54
|
&& targetType instanceof basic_1.IntegerType) {
|
|
55
|
-
message =
|
|
55
|
+
message = `${fieldName}: CHAR to Integer conversion`;
|
|
56
56
|
}
|
|
57
57
|
else if (sourceType instanceof basic_1.CharacterType
|
|
58
58
|
&& targetType instanceof basic_1.CharacterType
|
|
59
59
|
&& sourceType.getLength() > targetType.getLength()) {
|
|
60
|
-
message =
|
|
60
|
+
message = `${fieldName}: Source field longer than database field, CHAR -> CHAR`;
|
|
61
61
|
}
|
|
62
62
|
else if (sourceType instanceof basic_1.NumericType
|
|
63
63
|
&& targetType instanceof basic_1.NumericType
|
|
64
64
|
&& sourceType.getLength() > targetType.getLength()) {
|
|
65
|
-
message =
|
|
65
|
+
message = `${fieldName}: Source field longer than database field, NUMC -> NUMC`;
|
|
66
66
|
}
|
|
67
67
|
if (message !== "") {
|
|
68
68
|
input.scope.addSQLConversion(fieldName, message, token);
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseDynpros = parseDynpros;
|
|
4
4
|
const xml_utils_1 = require("../xml_utils");
|
|
5
|
+
function parseNumber(value) {
|
|
6
|
+
if (value === undefined) {
|
|
7
|
+
return 0;
|
|
8
|
+
}
|
|
9
|
+
return parseInt(value, 10);
|
|
10
|
+
}
|
|
5
11
|
function parseDynpros(parsed) {
|
|
6
12
|
var _a, _b, _c, _d;
|
|
7
13
|
const dynpros = [];
|
|
@@ -13,7 +19,10 @@ function parseDynpros(parsed) {
|
|
|
13
19
|
fields.push({
|
|
14
20
|
name: f.NAME,
|
|
15
21
|
type: f.TYPE,
|
|
16
|
-
length: f.LENGTH,
|
|
22
|
+
length: parseNumber(f.LENGTH),
|
|
23
|
+
line: parseNumber(f.LINE),
|
|
24
|
+
column: parseNumber(f.COLUMN),
|
|
25
|
+
height: parseNumber(f.HEIGHT),
|
|
17
26
|
});
|
|
18
27
|
}
|
|
19
28
|
dynpros.push({
|
package/build/src/registry.js
CHANGED
|
@@ -18,7 +18,7 @@ class DynproChecks {
|
|
|
18
18
|
key: "dynpro_checks",
|
|
19
19
|
title: "Dynpro Checks",
|
|
20
20
|
shortDescription: `Various Dynpro checks`,
|
|
21
|
-
extendedInformation: `* Check length of PUSH elements less than 132`,
|
|
21
|
+
extendedInformation: `* Check length of PUSH elements less than 132\n* Check for overlapping screen elements`,
|
|
22
22
|
tags: [_irule_1.RuleTag.Syntax],
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -47,9 +47,43 @@ class DynproChecks {
|
|
|
47
47
|
ret.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.getConfig().severity));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
ret.push(...this.findOverlappingFields(dynpro, file));
|
|
50
51
|
}
|
|
51
52
|
return ret;
|
|
52
53
|
}
|
|
54
|
+
findOverlappingFields(dynpro, file) {
|
|
55
|
+
const ret = [];
|
|
56
|
+
for (let index = 0; index < dynpro.fields.length; index++) {
|
|
57
|
+
const current = dynpro.fields[index];
|
|
58
|
+
if (current.name === undefined) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
for (let compare = index + 1; compare < dynpro.fields.length; compare++) {
|
|
62
|
+
const other = dynpro.fields[compare];
|
|
63
|
+
if (other.name === undefined || this.overlaps(current, other) === false) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const message = `Screen ${dynpro.number}, fields ${current.name} and ${other.name} are overlapping`;
|
|
67
|
+
ret.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.getConfig().severity));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return ret;
|
|
71
|
+
}
|
|
72
|
+
overlaps(first, second) {
|
|
73
|
+
if (first.line === 0 || second.line === 0 || first.column === 0 || second.column === 0) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const firstHeight = Math.max(first.height, 1);
|
|
77
|
+
const secondHeight = Math.max(second.height, 1);
|
|
78
|
+
const firstLastLine = first.line + firstHeight - 1;
|
|
79
|
+
const secondLastLine = second.line + secondHeight - 1;
|
|
80
|
+
if (firstLastLine < second.line || secondLastLine < first.line) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
const firstLastColumn = first.column + Math.max(first.length, 1) - 1;
|
|
84
|
+
const secondLastColumn = second.column + Math.max(second.length, 1) - 1;
|
|
85
|
+
return first.column <= secondLastColumn && second.column <= firstLastColumn;
|
|
86
|
+
}
|
|
53
87
|
}
|
|
54
88
|
exports.DynproChecks = DynproChecks;
|
|
55
89
|
//# sourceMappingURL=dynpro_checks.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.117.
|
|
3
|
+
"version": "2.117.1",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"url": "git+https://github.com/abaplint/abaplint.git"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"ABAP",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^5.5.
|
|
66
|
+
"fast-xml-parser": "^5.5.5",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|