@abaplint/cli 2.100.0 → 2.100.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.
Files changed (2) hide show
  1. package/build/cli.js +60 -2
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -29655,7 +29655,7 @@ const raise_with_1 = __webpack_require__(/*! ../expressions/raise_with */ "./nod
29655
29655
  class Raise {
29656
29656
  runSyntax(node, scope, filename) {
29657
29657
  // todo
29658
- var _a;
29658
+ var _a, _b, _c;
29659
29659
  const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
29660
29660
  const classNam = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
29661
29661
  if (classNam) {
@@ -29704,6 +29704,12 @@ class Raise {
29704
29704
  for (const s of node.findDirectExpressions(Expressions.MessageSource)) {
29705
29705
  new message_source_1.MessageSource().runSyntax(s, scope, filename);
29706
29706
  }
29707
+ const id = (_b = node.findExpressionAfterToken("ID")) === null || _b === void 0 ? void 0 : _b.concatTokens();
29708
+ const number = (_c = node.findDirectExpression(Expressions.MessageNumber)) === null || _c === void 0 ? void 0 : _c.concatTokens();
29709
+ if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
29710
+ const messageClass = id.substring(1, id.length - 1).toUpperCase();
29711
+ scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
29712
+ }
29707
29713
  }
29708
29714
  }
29709
29715
  exports.Raise = Raise;
@@ -39846,6 +39852,53 @@ exports.CodeActions = CodeActions;
39846
39852
 
39847
39853
  /***/ }),
39848
39854
 
39855
+ /***/ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js":
39856
+ /*!****************************************************************!*\
39857
+ !*** ./node_modules/@abaplint/core/build/src/lsp/code_lens.js ***!
39858
+ \****************************************************************/
39859
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
39860
+
39861
+ "use strict";
39862
+
39863
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
39864
+ exports.CodeLens = void 0;
39865
+ const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
39866
+ const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
39867
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
39868
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
39869
+ class CodeLens {
39870
+ constructor(reg) {
39871
+ this.reg = reg;
39872
+ }
39873
+ list(textDocument) {
39874
+ var _a;
39875
+ const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
39876
+ if (file === undefined) {
39877
+ return [];
39878
+ }
39879
+ const obj = this.reg.findObjectForFile(file);
39880
+ if (obj === undefined || !(obj instanceof _abap_object_1.ABAPObject)) {
39881
+ return [];
39882
+ }
39883
+ new syntax_1.SyntaxLogic(this.reg, obj).run();
39884
+ const ret = [];
39885
+ const list = this.reg.getMSAGReferences().listByFilename(file.getFilename());
39886
+ for (const l of list) {
39887
+ const msag = this.reg.getObject("MSAG", l.messageClass);
39888
+ if (msag === undefined) {
39889
+ continue;
39890
+ }
39891
+ const text = (_a = msag.getByNumber(l.number)) === null || _a === void 0 ? void 0 : _a.getMessage();
39892
+ ret.push(LServer.CodeLens.create(_lsp_utils_1.LSPUtils.tokenToRange(l.token), text));
39893
+ }
39894
+ return ret;
39895
+ }
39896
+ }
39897
+ exports.CodeLens = CodeLens;
39898
+ //# sourceMappingURL=code_lens.js.map
39899
+
39900
+ /***/ }),
39901
+
39849
39902
  /***/ "./node_modules/@abaplint/core/build/src/lsp/definition.js":
39850
39903
  /*!*****************************************************************!*\
39851
39904
  !*** ./node_modules/@abaplint/core/build/src/lsp/definition.js ***!
@@ -40543,6 +40596,7 @@ const references_1 = __webpack_require__(/*! ./references */ "./node_modules/@ab
40543
40596
  const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_modules/@abaplint/core/build/src/lsp/implementation.js");
40544
40597
  const semantic_1 = __webpack_require__(/*! ./semantic */ "./node_modules/@abaplint/core/build/src/lsp/semantic.js");
40545
40598
  const statement_flow_1 = __webpack_require__(/*! ../abap/flow/statement_flow */ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js");
40599
+ const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
40546
40600
  // note Ranges are zero based in LSP,
40547
40601
  // https://github.com/microsoft/language-server-protocol/blob/main/versions/protocol-2-x.md#range
40548
40602
  // but 1 based in abaplint
@@ -40623,6 +40677,10 @@ class LanguageServer {
40623
40677
  semanticTokensRange(range) {
40624
40678
  return new semantic_1.SemanticHighlighting(this.reg).semanticTokensRange(range);
40625
40679
  }
40680
+ // https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens
40681
+ codeLens(textDocument) {
40682
+ return new code_lens_1.CodeLens(this.reg).list(textDocument);
40683
+ }
40626
40684
  ////////////////////////////////////////
40627
40685
  // ______ _
40628
40686
  // | ____| | |
@@ -47698,7 +47756,7 @@ class Registry {
47698
47756
  }
47699
47757
  static abaplintVersion() {
47700
47758
  // magic, see build script "version.sh"
47701
- return "2.100.0";
47759
+ return "2.100.2";
47702
47760
  }
47703
47761
  getDDICReferences() {
47704
47762
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.100.0",
3
+ "version": "2.100.2",
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.100.0",
41
+ "@abaplint/core": "^2.100.2",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",