@abaplint/cli 2.119.2 → 2.119.3

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 +36 -4
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -23531,6 +23531,8 @@ var ScopeType;
23531
23531
  (function (ScopeType) {
23532
23532
  ScopeType["BuiltIn"] = "_builtin";
23533
23533
  ScopeType["Dummy"] = "_dummy";
23534
+ // definitions inside this one are local
23535
+ ScopeType["SelectionEvent"] = "selection_event";
23534
23536
  ScopeType["Global"] = "_global";
23535
23537
  ScopeType["Program"] = "_program";
23536
23538
  ScopeType["TypePool"] = "_type_pool";
@@ -36687,6 +36689,7 @@ const commit_entities_1 = __webpack_require__(/*! ./statements/commit_entities *
36687
36689
  const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
36688
36690
  const assert_error_1 = __webpack_require__(/*! ./assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
36689
36691
  const field_group_1 = __webpack_require__(/*! ./statements/field_group */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/field_group.js");
36692
+ const stuff_1 = __webpack_require__(/*! ../../stuff */ "./node_modules/@abaplint/core/build/src/stuff.js");
36690
36693
  // -----------------------------------
36691
36694
  const map = {};
36692
36695
  function addToMap(handler) {
@@ -36940,6 +36943,9 @@ class SyntaxLogic {
36940
36943
  updateScopeStructure(node) {
36941
36944
  const filename = this.currentFile.getFilename();
36942
36945
  const stru = node.get();
36946
+ if (this.scope.getType() === _scope_type_1.ScopeType.SelectionEvent && this.isSelectionEventBoundaryStructure(stru)) {
36947
+ this.scope.pop(node.getFirstToken().getStart());
36948
+ }
36943
36949
  const input = {
36944
36950
  scope: this.scope,
36945
36951
  filename,
@@ -36979,6 +36985,7 @@ class SyntaxLogic {
36979
36985
  updateScopeStatement(node) {
36980
36986
  const filename = this.currentFile.getFilename();
36981
36987
  const s = node.get();
36988
+ this.updateSelectionEventScope(node);
36982
36989
  const input = {
36983
36990
  scope: this.scope,
36984
36991
  filename,
@@ -37024,6 +37031,27 @@ class SyntaxLogic {
37024
37031
  }
37025
37032
  }
37026
37033
  }
37034
+ updateSelectionEventScope(node) {
37035
+ const statement = node.get();
37036
+ if (this.scope.getType() === _scope_type_1.ScopeType.SelectionEvent && this.isSelectionEventBoundary(statement)) {
37037
+ this.scope.pop(node.getFirstToken().getStart());
37038
+ }
37039
+ if (this.opensSelectionEventScope(statement)) {
37040
+ this.scope.push(_scope_type_1.ScopeType.SelectionEvent, statement.constructor.name, node.getFirstToken().getStart(), this.currentFile.getFilename());
37041
+ }
37042
+ }
37043
+ opensSelectionEventScope(statement) {
37044
+ return statement instanceof Statements.AtSelectionScreen;
37045
+ }
37046
+ isSelectionEventBoundary(statement) {
37047
+ return stuff_1.SELECTION_EVENTS.some(event => statement instanceof event)
37048
+ || statement instanceof Statements.Form
37049
+ || statement instanceof Statements.FunctionModule;
37050
+ }
37051
+ isSelectionEventBoundaryStructure(structure) {
37052
+ return structure instanceof Structures.ClassDefinition
37053
+ || structure instanceof Structures.Interface;
37054
+ }
37027
37055
  }
37028
37056
  exports.SyntaxLogic = SyntaxLogic;
37029
37057
  //# sourceMappingURL=syntax.js.map
@@ -40348,7 +40376,7 @@ class ClassDefinition extends _identifier_1.Identifier {
40348
40376
  input.scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename);
40349
40377
  }
40350
40378
  else {
40351
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, name.toUpperCase() + " does not exist"));
40379
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, "Friend class " + name.toUpperCase() + " does not exist"));
40352
40380
  }
40353
40381
  result.push(name);
40354
40382
  }
@@ -56149,7 +56177,7 @@ class Registry {
56149
56177
  }
56150
56178
  static abaplintVersion() {
56151
56179
  // magic, see build script "version.sh"
56152
- return "2.119.2";
56180
+ return "2.119.3";
56153
56181
  }
56154
56182
  getDDICReferences() {
56155
56183
  return this.ddicReferences;
@@ -68685,6 +68713,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
68685
68713
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
68686
68714
  const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
68687
68715
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
68716
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
68688
68717
  class KeepSingleParameterCallsOnOneLineConf extends _basic_rule_config_1.BasicRuleConfig {
68689
68718
  constructor() {
68690
68719
  super(...arguments);
@@ -68704,7 +68733,7 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
68704
68733
  title: "Keep single parameters on one line",
68705
68734
  shortDescription: `Keep single parameter calls on one line`,
68706
68735
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-single-parameter-calls-on-one-line`,
68707
- tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68736
+ tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
68708
68737
  badExample: `call_method(\n 2 ).`,
68709
68738
  goodExample: `call_method( 2 ).`,
68710
68739
  };
@@ -68780,7 +68809,8 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
68780
68809
  }
68781
68810
  }
68782
68811
  const message = "Keep single parameter on one line";
68783
- return [issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity)];
68812
+ const fix = edit_helper_1.EditHelper.replaceRange(file, c.getFirstToken().getStart(), c.getLastToken().getEnd(), c.concatTokens());
68813
+ return [issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix)];
68784
68814
  }
68785
68815
  return [];
68786
68816
  }
@@ -69871,6 +69901,7 @@ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/co
69871
69901
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
69872
69902
  const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
69873
69903
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
69904
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
69874
69905
  const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
69875
69906
  const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
69876
69907
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
@@ -69888,6 +69919,7 @@ class MainFileContents {
69888
69919
  key: "main_file_contents",
69889
69920
  title: "Main file contents",
69890
69921
  shortDescription: `Checks related to report declarations.`,
69922
+ tags: [_irule_1.RuleTag.Syntax],
69891
69923
  extendedInformation: `Does not run if the target version is Cloud
69892
69924
 
69893
69925
  * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.119.2",
3
+ "version": "2.119.3",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.119.2",
41
+ "@abaplint/core": "^2.119.3",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",