@abaplint/cli 2.101.12 → 2.101.13
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.
- package/build/cli.js +118 -16
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -25529,27 +25529,36 @@ class Source {
|
|
|
25529
25529
|
{
|
|
25530
25530
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
25531
25531
|
const bodyType = new reduce_body_1.ReduceBody().runSyntax(node.findDirectExpression(Expressions.ReduceBody), scope, filename, foundType);
|
|
25532
|
-
if (foundType === undefined || foundType.isGeneric()
|
|
25532
|
+
if (foundType === undefined || foundType.isGeneric()) {
|
|
25533
25533
|
this.addIfInferred(node, scope, filename, bodyType);
|
|
25534
25534
|
}
|
|
25535
|
+
else {
|
|
25536
|
+
this.addIfInferred(node, scope, filename, foundType);
|
|
25537
|
+
}
|
|
25535
25538
|
return foundType ? foundType : bodyType;
|
|
25536
25539
|
}
|
|
25537
25540
|
case "SWITCH":
|
|
25538
25541
|
{
|
|
25539
25542
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
25540
25543
|
const bodyType = new switch_body_1.SwitchBody().runSyntax(node.findDirectExpression(Expressions.SwitchBody), scope, filename);
|
|
25541
|
-
if (foundType === undefined || foundType.isGeneric()
|
|
25544
|
+
if (foundType === undefined || foundType.isGeneric()) {
|
|
25542
25545
|
this.addIfInferred(node, scope, filename, bodyType);
|
|
25543
25546
|
}
|
|
25547
|
+
else {
|
|
25548
|
+
this.addIfInferred(node, scope, filename, foundType);
|
|
25549
|
+
}
|
|
25544
25550
|
return foundType ? foundType : bodyType;
|
|
25545
25551
|
}
|
|
25546
25552
|
case "COND":
|
|
25547
25553
|
{
|
|
25548
25554
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
25549
25555
|
const bodyType = new cond_body_1.CondBody().runSyntax(node.findDirectExpression(Expressions.CondBody), scope, filename);
|
|
25550
|
-
if (foundType === undefined || foundType.isGeneric()
|
|
25556
|
+
if (foundType === undefined || foundType.isGeneric()) {
|
|
25551
25557
|
this.addIfInferred(node, scope, filename, bodyType);
|
|
25552
25558
|
}
|
|
25559
|
+
else {
|
|
25560
|
+
this.addIfInferred(node, scope, filename, foundType);
|
|
25561
|
+
}
|
|
25553
25562
|
return foundType ? foundType : bodyType;
|
|
25554
25563
|
}
|
|
25555
25564
|
case "CONV":
|
|
@@ -25686,10 +25695,12 @@ class Source {
|
|
|
25686
25695
|
throw new Error("determineType, child TypeNameOrInfer not found");
|
|
25687
25696
|
}
|
|
25688
25697
|
else if (typeName === "#" && targetType) {
|
|
25689
|
-
const found = basic.lookupQualifiedName(targetType.getQualifiedName());
|
|
25698
|
+
// const found = basic.lookupQualifiedName(targetType.getQualifiedName());
|
|
25699
|
+
/*
|
|
25690
25700
|
if (found) {
|
|
25691
|
-
|
|
25701
|
+
scope.addReference(typeToken, found, ReferenceType.InferredType, filename);
|
|
25692
25702
|
}
|
|
25703
|
+
*/
|
|
25693
25704
|
return targetType;
|
|
25694
25705
|
}
|
|
25695
25706
|
if (typeName !== "#" && typeToken) {
|
|
@@ -40007,6 +40018,9 @@ class LSPUtils {
|
|
|
40007
40018
|
static tokenToRange(token) {
|
|
40008
40019
|
return LServer.Range.create(token.getStart().getRow() - 1, token.getStart().getCol() - 1, token.getEnd().getRow() - 1, token.getEnd().getCol() - 1);
|
|
40009
40020
|
}
|
|
40021
|
+
static positionToLS(pos) {
|
|
40022
|
+
return LServer.Position.create(pos.getRow() - 1, pos.getCol() - 1);
|
|
40023
|
+
}
|
|
40010
40024
|
static identiferToLocation(identifier) {
|
|
40011
40025
|
return {
|
|
40012
40026
|
uri: identifier.getFilename(),
|
|
@@ -40166,7 +40180,7 @@ class CodeLens {
|
|
|
40166
40180
|
constructor(reg) {
|
|
40167
40181
|
this.reg = reg;
|
|
40168
40182
|
}
|
|
40169
|
-
list(textDocument) {
|
|
40183
|
+
list(textDocument, settings = { messageText: true }) {
|
|
40170
40184
|
var _a;
|
|
40171
40185
|
const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
|
|
40172
40186
|
if (file === undefined) {
|
|
@@ -40178,14 +40192,22 @@ class CodeLens {
|
|
|
40178
40192
|
}
|
|
40179
40193
|
new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
40180
40194
|
const ret = [];
|
|
40181
|
-
|
|
40182
|
-
|
|
40183
|
-
const
|
|
40184
|
-
|
|
40185
|
-
|
|
40195
|
+
if (settings.messageText === true) {
|
|
40196
|
+
const list = this.reg.getMSAGReferences().listByFilename(file.getFilename());
|
|
40197
|
+
for (const l of list) {
|
|
40198
|
+
const msag = this.reg.getObject("MSAG", l.messageClass);
|
|
40199
|
+
if (msag === undefined) {
|
|
40200
|
+
continue;
|
|
40201
|
+
}
|
|
40202
|
+
const text = (_a = msag.getByNumber(l.number)) === null || _a === void 0 ? void 0 : _a.getMessage();
|
|
40203
|
+
if (text === undefined) {
|
|
40204
|
+
continue;
|
|
40205
|
+
}
|
|
40206
|
+
ret.push({
|
|
40207
|
+
range: _lsp_utils_1.LSPUtils.tokenToRange(l.token),
|
|
40208
|
+
command: LServer.Command.create(text, ""),
|
|
40209
|
+
});
|
|
40186
40210
|
}
|
|
40187
|
-
const text = (_a = msag.getByNumber(l.number)) === null || _a === void 0 ? void 0 : _a.getMessage();
|
|
40188
|
-
ret.push(LServer.CodeLens.create(_lsp_utils_1.LSPUtils.tokenToRange(l.token), text));
|
|
40189
40211
|
}
|
|
40190
40212
|
return ret;
|
|
40191
40213
|
}
|
|
@@ -40867,6 +40889,81 @@ exports.Implementation = Implementation;
|
|
|
40867
40889
|
|
|
40868
40890
|
/***/ }),
|
|
40869
40891
|
|
|
40892
|
+
/***/ "./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js":
|
|
40893
|
+
/*!******************************************************************!*\
|
|
40894
|
+
!*** ./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js ***!
|
|
40895
|
+
\******************************************************************/
|
|
40896
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
40897
|
+
|
|
40898
|
+
"use strict";
|
|
40899
|
+
|
|
40900
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40901
|
+
exports.InlayHints = void 0;
|
|
40902
|
+
const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
|
|
40903
|
+
const _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ "./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js");
|
|
40904
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
40905
|
+
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
40906
|
+
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
40907
|
+
const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
40908
|
+
const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
40909
|
+
class InlayHints {
|
|
40910
|
+
constructor(reg) {
|
|
40911
|
+
this.reg = reg;
|
|
40912
|
+
}
|
|
40913
|
+
list(textDocument, settings = { inferredTypes: true }) {
|
|
40914
|
+
const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
|
|
40915
|
+
if (file === undefined) {
|
|
40916
|
+
return [];
|
|
40917
|
+
}
|
|
40918
|
+
const obj = this.reg.findObjectForFile(file);
|
|
40919
|
+
if (obj === undefined || !(obj instanceof _abap_object_1.ABAPObject)) {
|
|
40920
|
+
return [];
|
|
40921
|
+
}
|
|
40922
|
+
const top = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop();
|
|
40923
|
+
const ret = [];
|
|
40924
|
+
if (settings.inferredTypes === true) {
|
|
40925
|
+
const implicit = this.findImplicitReferences(top);
|
|
40926
|
+
for (const i of implicit) {
|
|
40927
|
+
let label = undefined;
|
|
40928
|
+
if (i.resolved instanceof _typed_identifier_1.TypedIdentifier) {
|
|
40929
|
+
label = "TYPE " + i.resolved.getType().toABAP();
|
|
40930
|
+
}
|
|
40931
|
+
else if (i.resolved instanceof types_1.ClassDefinition) {
|
|
40932
|
+
label = "TYPE REF TO " + i.resolved.getName();
|
|
40933
|
+
}
|
|
40934
|
+
if (label === undefined) {
|
|
40935
|
+
continue;
|
|
40936
|
+
}
|
|
40937
|
+
ret.push({
|
|
40938
|
+
label: label,
|
|
40939
|
+
tooltip: "Inferred type",
|
|
40940
|
+
kind: LServer.InlayHintKind.Type,
|
|
40941
|
+
paddingLeft: true,
|
|
40942
|
+
paddingRight: true,
|
|
40943
|
+
position: _lsp_utils_1.LSPUtils.positionToLS(i.position.getEnd()),
|
|
40944
|
+
});
|
|
40945
|
+
}
|
|
40946
|
+
}
|
|
40947
|
+
return ret;
|
|
40948
|
+
}
|
|
40949
|
+
findImplicitReferences(node) {
|
|
40950
|
+
const ret = [];
|
|
40951
|
+
for (const r of node.getData().references) {
|
|
40952
|
+
if (r.referenceType === _reference_1.ReferenceType.InferredType) {
|
|
40953
|
+
ret.push(r);
|
|
40954
|
+
}
|
|
40955
|
+
}
|
|
40956
|
+
for (const c of node.getChildren()) {
|
|
40957
|
+
ret.push(...this.findImplicitReferences(c));
|
|
40958
|
+
}
|
|
40959
|
+
return ret;
|
|
40960
|
+
}
|
|
40961
|
+
}
|
|
40962
|
+
exports.InlayHints = InlayHints;
|
|
40963
|
+
//# sourceMappingURL=inlay_hints.js.map
|
|
40964
|
+
|
|
40965
|
+
/***/ }),
|
|
40966
|
+
|
|
40870
40967
|
/***/ "./node_modules/@abaplint/core/build/src/lsp/language_server.js":
|
|
40871
40968
|
/*!**********************************************************************!*\
|
|
40872
40969
|
!*** ./node_modules/@abaplint/core/build/src/lsp/language_server.js ***!
|
|
@@ -40893,6 +40990,7 @@ const implementation_1 = __webpack_require__(/*! ./implementation */ "./node_mod
|
|
|
40893
40990
|
const semantic_1 = __webpack_require__(/*! ./semantic */ "./node_modules/@abaplint/core/build/src/lsp/semantic.js");
|
|
40894
40991
|
const statement_flow_1 = __webpack_require__(/*! ../abap/flow/statement_flow */ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js");
|
|
40895
40992
|
const code_lens_1 = __webpack_require__(/*! ./code_lens */ "./node_modules/@abaplint/core/build/src/lsp/code_lens.js");
|
|
40993
|
+
const inlay_hints_1 = __webpack_require__(/*! ./inlay_hints */ "./node_modules/@abaplint/core/build/src/lsp/inlay_hints.js");
|
|
40896
40994
|
// note Ranges are zero based in LSP,
|
|
40897
40995
|
// https://github.com/microsoft/language-server-protocol/blob/main/versions/protocol-2-x.md#range
|
|
40898
40996
|
// but 1 based in abaplint
|
|
@@ -40974,8 +41072,12 @@ class LanguageServer {
|
|
|
40974
41072
|
return new semantic_1.SemanticHighlighting(this.reg).semanticTokensRange(range);
|
|
40975
41073
|
}
|
|
40976
41074
|
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens
|
|
40977
|
-
codeLens(textDocument) {
|
|
40978
|
-
return new code_lens_1.CodeLens(this.reg).list(textDocument);
|
|
41075
|
+
codeLens(textDocument, settings) {
|
|
41076
|
+
return new code_lens_1.CodeLens(this.reg).list(textDocument, settings);
|
|
41077
|
+
}
|
|
41078
|
+
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint
|
|
41079
|
+
inlayHints(textDocument, settings) {
|
|
41080
|
+
return new inlay_hints_1.InlayHints(this.reg).list(textDocument, settings);
|
|
40979
41081
|
}
|
|
40980
41082
|
////////////////////////////////////////
|
|
40981
41083
|
// ______ _
|
|
@@ -48184,7 +48286,7 @@ class Registry {
|
|
|
48184
48286
|
}
|
|
48185
48287
|
static abaplintVersion() {
|
|
48186
48288
|
// magic, see build script "version.sh"
|
|
48187
|
-
return "2.101.
|
|
48289
|
+
return "2.101.13";
|
|
48188
48290
|
}
|
|
48189
48291
|
getDDICReferences() {
|
|
48190
48292
|
return this.ddicReferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.13",
|
|
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.101.
|
|
41
|
+
"@abaplint/core": "^2.101.13",
|
|
42
42
|
"@types/chai": "^4.3.5",
|
|
43
43
|
"@types/glob": "^7.2.0",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|