@abaplint/cli 2.118.9 → 2.118.10

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 +81 -1
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -53416,6 +53416,83 @@ exports.RenameMessageClass = RenameMessageClass;
53416
53416
 
53417
53417
  /***/ },
53418
53418
 
53419
+ /***/ "./node_modules/@abaplint/core/build/src/objects/rename/rename_program.js"
53420
+ /*!********************************************************************************!*\
53421
+ !*** ./node_modules/@abaplint/core/build/src/objects/rename/rename_program.js ***!
53422
+ \********************************************************************************/
53423
+ (__unused_webpack_module, exports, __webpack_require__) {
53424
+
53425
+ "use strict";
53426
+
53427
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
53428
+ exports.RenameProgram = void 0;
53429
+ const Statements = __webpack_require__(/*! ../../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
53430
+ const Expressions = __webpack_require__(/*! ../../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
53431
+ const vscode_languageserver_types_1 = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/umd/main.js");
53432
+ const __1 = __webpack_require__(/*! .. */ "./node_modules/@abaplint/core/build/src/objects/index.js");
53433
+ const renamer_helper_1 = __webpack_require__(/*! ./renamer_helper */ "./node_modules/@abaplint/core/build/src/objects/rename/renamer_helper.js");
53434
+ const _lsp_utils_1 = __webpack_require__(/*! ../../lsp/_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
53435
+ const _abap_object_1 = __webpack_require__(/*! ../_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
53436
+ class RenameProgram {
53437
+ constructor(reg) {
53438
+ this.reg = reg;
53439
+ }
53440
+ buildEdits(obj, oldName, newName) {
53441
+ if (!(obj instanceof __1.Program)) {
53442
+ throw new Error("RenameProgram, not a program");
53443
+ }
53444
+ const main = obj.getMainABAPFile();
53445
+ if (main === undefined) {
53446
+ throw new Error(`Main file not found, ${obj.getType()} ${obj.getName()}`);
53447
+ }
53448
+ let changes = [];
53449
+ const helper = new renamer_helper_1.RenamerHelper(this.reg);
53450
+ changes = changes.concat(helper.buildXMLFileEdits(obj, "NAME", oldName, newName));
53451
+ changes = changes.concat(helper.renameFiles(obj, oldName, newName));
53452
+ const edits = [];
53453
+ for (const s of main.getStatements()) {
53454
+ if (s.get() instanceof Statements.Report || s.get() instanceof Statements.Program) {
53455
+ const exp = s.findFirstExpression(Expressions.ReportName);
53456
+ if (exp) {
53457
+ edits.push(vscode_languageserver_types_1.TextEdit.replace(_lsp_utils_1.LSPUtils.tokenToRange(exp.getFirstToken()), newName.toLowerCase()));
53458
+ }
53459
+ }
53460
+ }
53461
+ if (edits.length > 0) {
53462
+ changes.push(vscode_languageserver_types_1.TextDocumentEdit.create({ uri: main.getFilename(), version: 1 }, edits));
53463
+ }
53464
+ // Rename INCLUDE statements in all ABAP objects
53465
+ for (const o of this.reg.getObjects()) {
53466
+ if (o instanceof _abap_object_1.ABAPObject && o !== obj) {
53467
+ for (const file of o.getABAPFiles()) {
53468
+ const includeEdits = [];
53469
+ for (const s of file.getStatements()) {
53470
+ if (s.get() instanceof Statements.Include ||
53471
+ s.get() instanceof Statements.Submit ||
53472
+ s.get() instanceof Statements.Perform) {
53473
+ for (const exp of s.findAllExpressions(Expressions.IncludeName)) {
53474
+ if (exp && exp.getFirstToken().getStr().toUpperCase() === oldName.toUpperCase()) {
53475
+ includeEdits.push(vscode_languageserver_types_1.TextEdit.replace(_lsp_utils_1.LSPUtils.tokenToRange(exp.getFirstToken()), newName.toLowerCase()));
53476
+ }
53477
+ }
53478
+ }
53479
+ }
53480
+ if (includeEdits.length > 0) {
53481
+ changes.push(vscode_languageserver_types_1.TextDocumentEdit.create({ uri: file.getFilename(), version: 1 }, includeEdits));
53482
+ }
53483
+ }
53484
+ }
53485
+ }
53486
+ return {
53487
+ documentChanges: changes,
53488
+ };
53489
+ }
53490
+ }
53491
+ exports.RenameProgram = RenameProgram;
53492
+ //# sourceMappingURL=rename_program.js.map
53493
+
53494
+ /***/ },
53495
+
53419
53496
  /***/ "./node_modules/@abaplint/core/build/src/objects/rename/rename_table.js"
53420
53497
  /*!******************************************************************************!*\
53421
53498
  !*** ./node_modules/@abaplint/core/build/src/objects/rename/rename_table.js ***!
@@ -53507,6 +53584,7 @@ const rename_data_element_1 = __webpack_require__(/*! ./rename_data_element */ "
53507
53584
  const rename_domain_1 = __webpack_require__(/*! ./rename_domain */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_domain.js");
53508
53585
  const rename_global_class_1 = __webpack_require__(/*! ./rename_global_class */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_global_class.js");
53509
53586
  const rename_global_interface_1 = __webpack_require__(/*! ./rename_global_interface */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_global_interface.js");
53587
+ const rename_program_1 = __webpack_require__(/*! ./rename_program */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_program.js");
53510
53588
  const rename_table_1 = __webpack_require__(/*! ./rename_table */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_table.js");
53511
53589
  const rename_table_type_1 = __webpack_require__(/*! ./rename_table_type */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_table_type.js");
53512
53590
  const rename_message_class_1 = __webpack_require__(/*! ./rename_message_class */ "./node_modules/@abaplint/core/build/src/objects/rename/rename_message_class.js");
@@ -53561,6 +53639,8 @@ class Renamer {
53561
53639
  return new rename_table_type_1.RenameTableType(this.reg);
53562
53640
  case "INTF":
53563
53641
  return new rename_global_interface_1.RenameGlobalInterface(this.reg);
53642
+ case "PROG":
53643
+ return new rename_program_1.RenameProgram(this.reg);
53564
53644
  case "MSAG":
53565
53645
  return new rename_message_class_1.RenameMessageClass(this.reg);
53566
53646
  case "SICF":
@@ -56048,7 +56128,7 @@ class Registry {
56048
56128
  }
56049
56129
  static abaplintVersion() {
56050
56130
  // magic, see build script "version.sh"
56051
- return "2.118.9";
56131
+ return "2.118.10";
56052
56132
  }
56053
56133
  getDDICReferences() {
56054
56134
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.118.9",
3
+ "version": "2.118.10",
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.118.9",
41
+ "@abaplint/core": "^2.118.10",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",