@abaplint/core 2.100.1 → 2.100.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.
- package/build/abaplint.d.ts +1 -0
- package/build/src/abap/5_syntax/expressions/source.js +1 -0
- package/build/src/ddic.js +1 -1
- package/build/src/lsp/code_lens.js +37 -0
- package/build/src/lsp/language_server.js +5 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/empty_line_in_statement.js +6 -2
- package/package.json +2 -2
package/build/abaplint.d.ts
CHANGED
|
@@ -3732,6 +3732,7 @@ export declare class LanguageServer {
|
|
|
3732
3732
|
references(params: ITextDocumentPositionParams): LServer.Location[];
|
|
3733
3733
|
static semanticTokensLegend(): LServer.SemanticTokensLegend;
|
|
3734
3734
|
semanticTokensRange(range: ITextDocumentRange): LServer.SemanticTokens;
|
|
3735
|
+
codeLens(textDocument: LServer.TextDocumentIdentifier): LServer.CodeLens[];
|
|
3735
3736
|
help(textDocument: LServer.TextDocumentIdentifier, position: LServer.Position): string;
|
|
3736
3737
|
listDefinitionPositions(textDocument: LServer.TextDocumentIdentifier): LServer.Range[];
|
|
3737
3738
|
listReadPositions(textDocument: LServer.TextDocumentIdentifier): LServer.Range[];
|
|
@@ -92,6 +92,7 @@ class Source {
|
|
|
92
92
|
{
|
|
93
93
|
const foundType = this.determineType(node, scope, filename, targetType);
|
|
94
94
|
new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
|
|
95
|
+
this.addIfInferred(node, scope, filename, foundType);
|
|
95
96
|
return foundType;
|
|
96
97
|
}
|
|
97
98
|
case "REF":
|
package/build/src/ddic.js
CHANGED
|
@@ -375,7 +375,7 @@ class DDIC {
|
|
|
375
375
|
case "SSTRING": // 1 <= len <= 1333
|
|
376
376
|
case "STRG": // 256 <= len
|
|
377
377
|
case "STRING": // 256 <= len
|
|
378
|
-
return new Types.StringType({ qualifiedName: qualifiedName });
|
|
378
|
+
return new Types.StringType({ qualifiedName: qualifiedName || "STRING" });
|
|
379
379
|
case "RSTR": // 256 <= len
|
|
380
380
|
case "RAWSTRING": // 256 <= len
|
|
381
381
|
case "GEOM_EWKB":
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeLens = void 0;
|
|
4
|
+
const LServer = require("vscode-languageserver-types");
|
|
5
|
+
const _lsp_utils_1 = require("./_lsp_utils");
|
|
6
|
+
const syntax_1 = require("../abap/5_syntax/syntax");
|
|
7
|
+
const _abap_object_1 = require("../objects/_abap_object");
|
|
8
|
+
class CodeLens {
|
|
9
|
+
constructor(reg) {
|
|
10
|
+
this.reg = reg;
|
|
11
|
+
}
|
|
12
|
+
list(textDocument) {
|
|
13
|
+
var _a;
|
|
14
|
+
const file = _lsp_utils_1.LSPUtils.getABAPFile(this.reg, textDocument.uri);
|
|
15
|
+
if (file === undefined) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const obj = this.reg.findObjectForFile(file);
|
|
19
|
+
if (obj === undefined || !(obj instanceof _abap_object_1.ABAPObject)) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
23
|
+
const ret = [];
|
|
24
|
+
const list = this.reg.getMSAGReferences().listByFilename(file.getFilename());
|
|
25
|
+
for (const l of list) {
|
|
26
|
+
const msag = this.reg.getObject("MSAG", l.messageClass);
|
|
27
|
+
if (msag === undefined) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const text = (_a = msag.getByNumber(l.number)) === null || _a === void 0 ? void 0 : _a.getMessage();
|
|
31
|
+
ret.push(LServer.CodeLens.create(_lsp_utils_1.LSPUtils.tokenToRange(l.token), text));
|
|
32
|
+
}
|
|
33
|
+
return ret;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.CodeLens = CodeLens;
|
|
37
|
+
//# sourceMappingURL=code_lens.js.map
|
|
@@ -16,6 +16,7 @@ const references_1 = require("./references");
|
|
|
16
16
|
const implementation_1 = require("./implementation");
|
|
17
17
|
const semantic_1 = require("./semantic");
|
|
18
18
|
const statement_flow_1 = require("../abap/flow/statement_flow");
|
|
19
|
+
const code_lens_1 = require("./code_lens");
|
|
19
20
|
// note Ranges are zero based in LSP,
|
|
20
21
|
// https://github.com/microsoft/language-server-protocol/blob/main/versions/protocol-2-x.md#range
|
|
21
22
|
// but 1 based in abaplint
|
|
@@ -96,6 +97,10 @@ class LanguageServer {
|
|
|
96
97
|
semanticTokensRange(range) {
|
|
97
98
|
return new semantic_1.SemanticHighlighting(this.reg).semanticTokensRange(range);
|
|
98
99
|
}
|
|
100
|
+
// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeLens
|
|
101
|
+
codeLens(textDocument) {
|
|
102
|
+
return new code_lens_1.CodeLens(this.reg).list(textDocument);
|
|
103
|
+
}
|
|
99
104
|
////////////////////////////////////////
|
|
100
105
|
// ______ _
|
|
101
106
|
// | ____| | |
|
package/build/src/registry.js
CHANGED
|
@@ -27,8 +27,12 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
27
27
|
key: "empty_line_in_statement",
|
|
28
28
|
title: "Find empty lines in statements",
|
|
29
29
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
30
|
-
extendedInformation: `https://
|
|
31
|
-
|
|
30
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
31
|
+
|
|
32
|
+
https://docs.abapopenchecks.org/checks/41/`,
|
|
33
|
+
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
34
|
+
badExample: `WRITE\n\nhello.`,
|
|
35
|
+
goodExample: `WRITE hello.`,
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
38
|
getMessage() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.100.
|
|
3
|
+
"version": "2.100.3",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@microsoft/api-extractor": "^7.34.9",
|
|
52
52
|
"@types/chai": "^4.3.5",
|
|
53
53
|
"@types/mocha": "^10.0.1",
|
|
54
|
-
"@types/node": "^20.1.
|
|
54
|
+
"@types/node": "^20.1.5",
|
|
55
55
|
"chai": "^4.3.7",
|
|
56
56
|
"eslint": "^8.40.0",
|
|
57
57
|
"mocha": "^10.2.0",
|