@abaplint/core 2.117.0 → 2.117.2

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.
@@ -1993,6 +1993,10 @@ declare type DynproField = {
1993
1993
  name: string;
1994
1994
  type: string;
1995
1995
  length: number;
1996
+ vislength: number;
1997
+ line: number;
1998
+ column: number;
1999
+ height: number;
1996
2000
  };
1997
2001
 
1998
2002
  declare type DynproHeader = {
@@ -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 = "Integer to CHAR conversion";
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 = "Integer to NUMC conversion";
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 = "NUMC to Integer conversion";
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 = "CHAR to Integer conversion";
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 = "Source field longer than database field, CHAR -> CHAR";
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 = "Source field longer than database field, NUMC -> NUMC";
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,11 @@ 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
+ vislength: parseNumber(f.VISLENGTH),
24
+ line: parseNumber(f.LINE),
25
+ column: parseNumber(f.COLUMN),
26
+ height: parseNumber(f.HEIGHT),
17
27
  });
18
28
  }
19
29
  dynpros.push({
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.sh"
77
- return "2.117.0";
77
+ return "2.117.2";
78
78
  }
79
79
  getDDICReferences() {
80
80
  return this.ddicReferences;
@@ -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 || current.type === "FRAME") {
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 || other.type === "FRAME" || this.overlaps(current, other) === false) {
64
+ continue;
65
+ }
66
+ const message = `Screen ${dynpro.number}, ${current.type} ${current.name} and ${other.type} ${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.vislength || first.length, 1) - 1;
84
+ const secondLastColumn = second.column + Math.max(second.vislength || 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
@@ -22,7 +22,8 @@ class MSAGConsistency {
22
22
  key: "msag_consistency",
23
23
  title: "MSAG consistency check",
24
24
  shortDescription: `Checks the validity of messages in message classes`,
25
- extendedInformation: `Message numbers must be 3 digits, message text must not be empty, no message number duplicates`,
25
+ extendedInformation: `Message numbers must be 3 digits, message text must not be empty,\n` +
26
+ `message text must not exceed 73 characters, no message number duplicates`,
26
27
  };
27
28
  }
28
29
  getDescription(reason) {
@@ -58,6 +59,12 @@ class MSAGConsistency {
58
59
  const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
59
60
  issues.push(issue);
60
61
  }
62
+ if (message.getMessage().length > 73) {
63
+ const text = `Message text too long (max 73 characters): message ${message.getNumber()}`;
64
+ const position = new position_1.Position(1, 1);
65
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
66
+ issues.push(issue);
67
+ }
61
68
  const num = message.getNumber();
62
69
  if (numbers.has(num)) {
63
70
  const text = "Duplicate message number " + num;
@@ -71,7 +78,7 @@ class MSAGConsistency {
71
78
  if (this.getConfig().numericParameters === true) {
72
79
  const placeholderCount = message.getPlaceholderCount();
73
80
  if (placeholderCount > 4) {
74
- const text = `More than 4 placeholders in mesasge ${message.getNumber()}`;
81
+ const text = `More than 4 placeholders in message ${message.getNumber()}`;
75
82
  const position = new position_1.Position(1, 1);
76
83
  const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
77
84
  issues.push(issue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.117.0",
3
+ "version": "2.117.2",
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": ">=12.0.0"
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.3",
66
+ "fast-xml-parser": "^5.5.5",
67
67
  "json5": "^2.2.3",
68
68
  "vscode-languageserver-types": "^3.17.5"
69
69
  }