@abaplint/cli 2.119.47 → 2.119.48

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.
Files changed (2) hide show
  1. package/build/cli.js +23 -4
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -26964,8 +26964,8 @@ exports.syntaxIssue = syntaxIssue;
26964
26964
  const issue_1 = __webpack_require__(/*! ../../issue */ "../core/build/src/issue.js");
26965
26965
  const severity_1 = __webpack_require__(/*! ../../severity */ "../core/build/src/severity.js");
26966
26966
  exports.CheckSyntaxKey = "check_syntax";
26967
- function syntaxIssue(input, token, message) {
26968
- return issue_1.Issue.atTokenFilename(input.filename, token, message, exports.CheckSyntaxKey, severity_1.Severity.Error);
26967
+ function syntaxIssue(input, token, message, fix) {
26968
+ return issue_1.Issue.atTokenFilename(input.filename, token, message, exports.CheckSyntaxKey, severity_1.Severity.Error, fix);
26969
26969
  }
26970
26970
  //# sourceMappingURL=_syntax_input.js.map
26971
26971
 
@@ -33225,7 +33225,7 @@ class Select {
33225
33225
  && from.getFirstToken().getStart().isBefore(up.getFirstToken().getStart())
33226
33226
  && up.getFirstToken().getStart().isBefore(intoExpression.getFirstToken().getStart())) {
33227
33227
  const message = `The addition "UP TO n ROWS" must only be placed after the INTO/APPENDING clause.`;
33228
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, up.getFirstToken(), message));
33228
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, up.getFirstToken(), message, this.buildUpToRowsFix(node, input, up, intoExpression)));
33229
33229
  }
33230
33230
  for (const s of up.findDirectExpressions(Expressions.SQLSource)) {
33231
33231
  sql_source_1.SQLSource.runSyntax(s, input);
@@ -33259,6 +33259,25 @@ class Select {
33259
33259
  input.scope.pop(node.getLastToken().getEnd());
33260
33260
  }
33261
33261
  }
33262
+ static buildUpToRowsFix(node, input, up, intoExpression) {
33263
+ const tokens = node.getTokens();
33264
+ const upLast = up.getLastToken();
33265
+ const next = tokens[tokens.findIndex(t => t === upLast) + 1];
33266
+ const deleteEnd = (next === null || next === void 0 ? void 0 : next.getStart()) || upLast.getEnd();
33267
+ const range = { start: up.getFirstToken().getStart(), end: deleteEnd };
33268
+ return {
33269
+ [input.filename]: [
33270
+ {
33271
+ range: { start: intoExpression.getLastToken().getEnd(), end: intoExpression.getLastToken().getEnd() },
33272
+ newText: " " + up.concatTokens(),
33273
+ },
33274
+ {
33275
+ range,
33276
+ newText: "",
33277
+ },
33278
+ ],
33279
+ };
33280
+ }
33262
33281
  // there are multiple rules, but gotta start somewhere
33263
33282
  static isStrictMode(node, input) {
33264
33283
  // strict OpenSQL is always required in the cloud language version
@@ -67911,7 +67930,7 @@ class Registry {
67911
67930
  }
67912
67931
  static abaplintVersion() {
67913
67932
  // magic, see build script "version.js"
67914
- return "2.119.47";
67933
+ return "2.119.48";
67915
67934
  }
67916
67935
  getDDICReferences() {
67917
67936
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.119.47",
3
+ "version": "2.119.48",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.119.47",
42
+ "@abaplint/core": "^2.119.48",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",