@abaplint/cli 2.99.8 → 2.99.9

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 -20
  2. package/package.json +4 -4
package/build/cli.js CHANGED
@@ -30718,7 +30718,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
30718
30718
  exports.Tables = void 0;
30719
30719
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
30720
30720
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
30721
- const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
30721
+ const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
30722
30722
  class Tables {
30723
30723
  runSyntax(node, scope, filename) {
30724
30724
  var _a, _b;
@@ -30730,13 +30730,15 @@ class Tables {
30730
30730
  if (name.startsWith("*")) {
30731
30731
  name = name.substr(1);
30732
30732
  }
30733
+ // lookupTableOrView will also give Unknown and Void
30733
30734
  const found = (_b = scope.getDDIC()) === null || _b === void 0 ? void 0 : _b.lookupTableOrView(name);
30734
30735
  if (found) {
30735
30736
  scope.getDDICReferences().addUsing(scope.getParentObj(), { object: found.object, filename: filename, token: nameToken });
30736
30737
  scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, found.type));
30737
30738
  return;
30738
30739
  }
30739
- scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new basic_1.UnknownType("Tables, fallback")));
30740
+ // this should never happen,
30741
+ scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new unknown_type_1.UnknownType("Tables, fallback")));
30740
30742
  }
30741
30743
  }
30742
30744
  exports.Tables = Tables;
@@ -39381,21 +39383,27 @@ class LSPLookup {
39381
39383
  const hover = "Method Definition \"" + method.getName() + "\"";
39382
39384
  return { hover, definition: found, definitionId: method, scope: bottomScope };
39383
39385
  }
39386
+ let hoverValue = "";
39387
+ const ddicRefs = reg.getDDICReferences().listByFilename(cursor.identifier.getFilename(), cursor.identifier.getStart().getRow());
39388
+ for (const d of ddicRefs) {
39389
+ if (d.object && d.token && d.token.getStart().equals(cursor.identifier.getStart())) {
39390
+ hoverValue += `DDIC: ${d.object.getType()} ${d.object.getName()}`;
39391
+ }
39392
+ }
39384
39393
  const variable = bottomScope.findVariable(cursor.token.getStr());
39385
39394
  if (variable !== undefined && variable.getStart().equals(cursor.token.getStart())) {
39386
39395
  const hover = "Variable Definition\n\n" + this.dumpType(variable);
39396
+ if (hoverValue !== "") {
39397
+ hoverValue = hover + "\n_________________\n" + hoverValue;
39398
+ }
39399
+ else {
39400
+ hoverValue = hover;
39401
+ }
39387
39402
  let location = undefined;
39388
39403
  if (variable.getMeta().includes("built-in" /* IdentifierMeta.BuiltIn */) === false) {
39389
39404
  location = _lsp_utils_1.LSPUtils.identiferToLocation(variable);
39390
39405
  }
39391
- return { hover, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
39392
- }
39393
- let hoverValue = "";
39394
- const ddicRefs = reg.getDDICReferences().listByFilename(cursor.identifier.getFilename(), cursor.identifier.getStart().getRow());
39395
- for (const d of ddicRefs) {
39396
- if (d.object && d.token && d.token.getStart().equals(cursor.identifier.getStart())) {
39397
- hoverValue += `DDIC: ${d.object.getType()} ${d.object.getName()}`;
39398
- }
39406
+ return { hover: hoverValue, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
39399
39407
  }
39400
39408
  const refs = this.searchReferences(bottomScope, cursor.token);
39401
39409
  if (refs.length > 0) {
@@ -44983,10 +44991,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
44983
44991
  exports.Program = void 0;
44984
44992
  const _abap_object_1 = __webpack_require__(/*! ./_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
44985
44993
  class Program extends _abap_object_1.ABAPObject {
44986
- constructor() {
44987
- super(...arguments);
44988
- this.isIncludeValue = undefined;
44989
- }
44990
44994
  getType() {
44991
44995
  return "PROG";
44992
44996
  }
@@ -45008,15 +45012,25 @@ class Program extends _abap_object_1.ABAPObject {
45008
45012
  };
45009
45013
  }
45010
45014
  setDirty() {
45011
- this.isIncludeValue = undefined;
45015
+ this.parsedXML = undefined;
45012
45016
  super.setDirty();
45013
45017
  }
45014
45018
  isInclude() {
45015
- if (this.isIncludeValue === undefined) {
45019
+ this.parseXML();
45020
+ return this.parsedXML.isInclude;
45021
+ }
45022
+ isModulePool() {
45023
+ this.parseXML();
45024
+ return this.parsedXML.isModulePool;
45025
+ }
45026
+ parseXML() {
45027
+ if (this.parsedXML === undefined) {
45016
45028
  const file = this.getXMLFile();
45017
- this.isIncludeValue = file ? file.getRaw().includes("<SUBC>I</SUBC>") : false;
45029
+ this.parsedXML = {
45030
+ isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
45031
+ isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
45032
+ };
45018
45033
  }
45019
- return this.isIncludeValue;
45020
45034
  }
45021
45035
  }
45022
45036
  exports.Program = Program;
@@ -47591,7 +47605,7 @@ class Registry {
47591
47605
  }
47592
47606
  static abaplintVersion() {
47593
47607
  // magic, see build script "version.sh"
47594
- return "2.99.8";
47608
+ return "2.99.9";
47595
47609
  }
47596
47610
  getDDICReferences() {
47597
47611
  return this.references;
@@ -58904,7 +58918,9 @@ class MainFileContents {
58904
58918
  if (stru === undefined) {
58905
58919
  return [];
58906
58920
  }
58907
- if (obj instanceof Objects.Program && obj.isInclude() === false) {
58921
+ if (obj instanceof Objects.Program
58922
+ && obj.isInclude() === false
58923
+ && obj.isModulePool() === false) {
58908
58924
  let count = 0;
58909
58925
  let first = main.getStatements()[count];
58910
58926
  while (first !== undefined && first.get() instanceof _statement_1.Comment) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.99.8",
3
+ "version": "2.99.9",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "bin": {
6
6
  "abaplint": "./abaplint"
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "homepage": "https://abaplint.org",
39
39
  "devDependencies": {
40
- "@abaplint/core": "^2.99.8",
40
+ "@abaplint/core": "^2.99.9",
41
41
  "@types/chai": "^4.3.5",
42
42
  "@types/glob": "^7.2.0",
43
43
  "@types/minimist": "^1.2.2",
44
44
  "@types/mocha": "^10.0.1",
45
- "@types/node": "^20.1.0",
45
+ "@types/node": "^20.1.1",
46
46
  "@types/progress": "^2.0.5",
47
47
  "chai": "^4.3.7",
48
48
  "chalk": "^5.2.0",
@@ -55,7 +55,7 @@
55
55
  "progress": "^2.0.3",
56
56
  "typescript": "^5.0.4",
57
57
  "webpack": "^5.82.0",
58
- "webpack-cli": "^5.1.0",
58
+ "webpack-cli": "^5.1.1",
59
59
  "xml-js": "^1.6.11"
60
60
  },
61
61
  "dependencies": {}