@abaplint/core 2.90.4 → 2.90.7
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 +2 -3
- package/build/src/abap/1_lexer/lexer.js +10 -7
- package/build/src/abap/2_statements/expressions/method_param_name.js +1 -1
- package/build/src/abap/5_syntax/_builtin.js +3 -3
- package/build/src/lsp/semantic.js +5 -5
- package/build/src/registry.js +1 -1
- package/build/src/rules/dangerous_statement.js +5 -4
- package/build/src/rules/slow_parameter_passing.js +1 -1
- package/package.json +6 -7
package/build/abaplint.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as LServer from 'vscode-languageserver-types';
|
|
2
|
-
import * as SemanticProtocol from 'vscode-languageserver-protocol/lib/common/protocol.semanticTokens';
|
|
3
2
|
import { WorkspaceEdit } from 'vscode-languageserver-types';
|
|
4
3
|
|
|
5
4
|
export declare class ABAPFile extends AbstractFile {
|
|
@@ -3447,8 +3446,8 @@ export declare class LanguageServer {
|
|
|
3447
3446
|
documentHighlight(_params: ITextDocumentPositionParams): LServer.DocumentHighlight[];
|
|
3448
3447
|
implementation(params: ITextDocumentPositionParams): LServer.Location[];
|
|
3449
3448
|
references(params: ITextDocumentPositionParams): LServer.Location[];
|
|
3450
|
-
static semanticTokensLegend():
|
|
3451
|
-
semanticTokensRange(range: ITextDocumentRange):
|
|
3449
|
+
static semanticTokensLegend(): LServer.SemanticTokensLegend;
|
|
3450
|
+
semanticTokensRange(range: ITextDocumentRange): LServer.SemanticTokens;
|
|
3452
3451
|
help(textDocument: LServer.TextDocumentIdentifier, position: LServer.Position): string;
|
|
3453
3452
|
listDefinitionPositions(textDocument: LServer.TextDocumentIdentifier): LServer.Range[];
|
|
3454
3453
|
listReadPositions(textDocument: LServer.TextDocumentIdentifier): LServer.Range[];
|
|
@@ -69,6 +69,12 @@ class Stream {
|
|
|
69
69
|
nextNextChar() {
|
|
70
70
|
return this.raw.substr(this.offset + 1, 2);
|
|
71
71
|
}
|
|
72
|
+
getRaw() {
|
|
73
|
+
return this.raw;
|
|
74
|
+
}
|
|
75
|
+
getOffset() {
|
|
76
|
+
return this.offset;
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
class Lexer {
|
|
74
80
|
static run(file, virtual) {
|
|
@@ -84,10 +90,7 @@ class Lexer {
|
|
|
84
90
|
const col = this.stream.getCol();
|
|
85
91
|
const row = this.stream.getRow();
|
|
86
92
|
let whiteBefore = false;
|
|
87
|
-
|
|
88
|
-
if (s.length === 2) {
|
|
89
|
-
prev = this.stream.prevPrevChar().substr(0, 1);
|
|
90
|
-
}
|
|
93
|
+
const prev = this.stream.getRaw().substr(this.stream.getOffset() - s.length, 1);
|
|
91
94
|
if (prev === " " || prev === "\n" || prev === "\t" || prev === ":") {
|
|
92
95
|
whiteBefore = true;
|
|
93
96
|
}
|
|
@@ -113,13 +116,13 @@ class Lexer {
|
|
|
113
116
|
if (first === "|" && last === "|") {
|
|
114
117
|
tok = new Tokens.StringTemplate(pos, s);
|
|
115
118
|
}
|
|
116
|
-
else if (first === "|" && last === "{") {
|
|
119
|
+
else if (first === "|" && last === "{" && whiteAfter === true) {
|
|
117
120
|
tok = new Tokens.StringTemplateBegin(pos, s);
|
|
118
121
|
}
|
|
119
|
-
else if (first === "}" && last === "|") {
|
|
122
|
+
else if (first === "}" && last === "|" && whiteBefore === true) {
|
|
120
123
|
tok = new Tokens.StringTemplateEnd(pos, s);
|
|
121
124
|
}
|
|
122
|
-
else if (first === "}" && last === "{") {
|
|
125
|
+
else if (first === "}" && last === "{" && whiteAfter === true && whiteBefore === true) {
|
|
123
126
|
tok = new Tokens.StringTemplateMiddle(pos, s);
|
|
124
127
|
}
|
|
125
128
|
else {
|
|
@@ -4,7 +4,7 @@ exports.MethodParamName = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
class MethodParamName extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
const field = (0, combi_1.regex)(
|
|
7
|
+
const field = (0, combi_1.regex)(/^!?\w*(\/\w+\/)?\w+$/);
|
|
8
8
|
return field;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -475,7 +475,7 @@ BuiltIn.methods = [
|
|
|
475
475
|
"off": new basic_1.IntegerType(),
|
|
476
476
|
"len": new basic_1.IntegerType(),
|
|
477
477
|
},
|
|
478
|
-
return: new basic_1.
|
|
478
|
+
return: new basic_1.IntegerType(),
|
|
479
479
|
version: version_1.Version.v702,
|
|
480
480
|
},
|
|
481
481
|
{
|
|
@@ -491,7 +491,7 @@ BuiltIn.methods = [
|
|
|
491
491
|
"off": new basic_1.IntegerType(),
|
|
492
492
|
"len": new basic_1.IntegerType(),
|
|
493
493
|
},
|
|
494
|
-
return: new basic_1.
|
|
494
|
+
return: new basic_1.IntegerType(),
|
|
495
495
|
version: version_1.Version.v702,
|
|
496
496
|
},
|
|
497
497
|
{
|
|
@@ -507,7 +507,7 @@ BuiltIn.methods = [
|
|
|
507
507
|
"off": new basic_1.IntegerType(),
|
|
508
508
|
"len": new basic_1.IntegerType(),
|
|
509
509
|
},
|
|
510
|
-
return: new basic_1.
|
|
510
|
+
return: new basic_1.IntegerType(),
|
|
511
511
|
version: version_1.Version.v702,
|
|
512
512
|
},
|
|
513
513
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SemanticHighlighting = void 0;
|
|
4
|
-
const
|
|
4
|
+
const LServer = require("vscode-languageserver-types");
|
|
5
5
|
const position_1 = require("../position");
|
|
6
6
|
const tokens_1 = require("../abap/1_lexer/tokens");
|
|
7
7
|
const nodes_1 = require("../abap/nodes");
|
|
@@ -30,7 +30,7 @@ class SemanticHighlighting {
|
|
|
30
30
|
SemanticHighlighting.tokenTypes.push(SOURCE_ABAP);
|
|
31
31
|
SemanticHighlighting.tokenTypeMap[BLOCK_ABAP] = SemanticHighlighting.tokenTypes.length;
|
|
32
32
|
SemanticHighlighting.tokenTypes.push(BLOCK_ABAP);
|
|
33
|
-
for (const t in
|
|
33
|
+
for (const t in LServer.SemanticTokenTypes) {
|
|
34
34
|
SemanticHighlighting.tokenTypeMap[t] = SemanticHighlighting.tokenTypes.length;
|
|
35
35
|
SemanticHighlighting.tokenTypes.push(t);
|
|
36
36
|
}
|
|
@@ -58,7 +58,7 @@ class SemanticHighlighting {
|
|
|
58
58
|
const statementInstance = s.get();
|
|
59
59
|
for (const t of s.getTokenNodes()) {
|
|
60
60
|
const tokenInstance = t.get();
|
|
61
|
-
let tokenType =
|
|
61
|
+
let tokenType = LServer.SemanticTokenTypes.keyword;
|
|
62
62
|
if (tokenInstance instanceof tokens_1.Punctuation) {
|
|
63
63
|
tokenType = SOURCE_ABAP;
|
|
64
64
|
}
|
|
@@ -81,10 +81,10 @@ class SemanticHighlighting {
|
|
|
81
81
|
|| tokenInstance instanceof tokens_1.StringTemplateBegin
|
|
82
82
|
|| tokenInstance instanceof tokens_1.StringTemplateEnd
|
|
83
83
|
|| tokenInstance instanceof tokens_1.StringTemplateMiddle) {
|
|
84
|
-
tokenType =
|
|
84
|
+
tokenType = LServer.SemanticTokenTypes.string;
|
|
85
85
|
}
|
|
86
86
|
else if (tokenInstance instanceof tokens_1.Comment) {
|
|
87
|
-
tokenType =
|
|
87
|
+
tokenType = LServer.SemanticTokenTypes.comment;
|
|
88
88
|
}
|
|
89
89
|
else if (t instanceof nodes_1.TokenNodeRegex) {
|
|
90
90
|
tokenType = SOURCE_ABAP;
|
package/build/src/registry.js
CHANGED
|
@@ -24,7 +24,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
24
24
|
this.deleteReport = true;
|
|
25
25
|
this.deleteTextpool = true;
|
|
26
26
|
this.deleteDynpro = true;
|
|
27
|
-
this.
|
|
27
|
+
this.exportDynpro = true;
|
|
28
28
|
/** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
|
|
29
29
|
this.dynamicSQL = true;
|
|
30
30
|
}
|
|
@@ -89,8 +89,8 @@ dynamic SQL can potentially create SQL injection problems`,
|
|
|
89
89
|
else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
|
|
90
90
|
message = "DELETE DYNPRO";
|
|
91
91
|
}
|
|
92
|
-
else if (this.conf.
|
|
93
|
-
message = "
|
|
92
|
+
else if (this.conf.exportDynpro && statement instanceof Statements.ExportDynpro) {
|
|
93
|
+
message = "EXPORT DYNPRO";
|
|
94
94
|
}
|
|
95
95
|
if (message) {
|
|
96
96
|
issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));
|
|
@@ -112,7 +112,8 @@ dynamic SQL can potentially create SQL injection problems`,
|
|
|
112
112
|
|| statement instanceof Statements.InsertDatabase
|
|
113
113
|
|| statement instanceof Statements.ModifyDatabase
|
|
114
114
|
|| statement instanceof Statements.DeleteDatabase) {
|
|
115
|
-
|
|
115
|
+
const dyn = statementNode.findFirstExpression(Expressions.Dynamic);
|
|
116
|
+
if (dyn && dyn.findDirectExpression(Expressions.Constant) === undefined) {
|
|
116
117
|
return "Dynamic SQL";
|
|
117
118
|
}
|
|
118
119
|
}
|
|
@@ -19,7 +19,7 @@ class SlowParameterPassing {
|
|
|
19
19
|
return {
|
|
20
20
|
key: "slow_parameter_passing",
|
|
21
21
|
title: "Slow Parameter Passing",
|
|
22
|
-
shortDescription: `Detects
|
|
22
|
+
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
23
23
|
tags: [_irule_1.RuleTag.Performance],
|
|
24
24
|
};
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.90.
|
|
3
|
+
"version": "2.90.7",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://abaplint.org",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.
|
|
48
|
+
"@microsoft/api-extractor": "^7.24.1",
|
|
49
49
|
"@types/chai": "^4.3.1",
|
|
50
50
|
"@types/mocha": "^9.1.1",
|
|
51
|
-
"@types/node": "^17.0.
|
|
51
|
+
"@types/node": "^17.0.35",
|
|
52
52
|
"chai": "^4.3.6",
|
|
53
|
-
"eslint": "^8.
|
|
53
|
+
"eslint": "^8.16.0",
|
|
54
54
|
"mocha": "^10.0.0",
|
|
55
|
-
"c8": "^7.11.
|
|
55
|
+
"c8": "^7.11.3",
|
|
56
56
|
"source-map-support": "^0.5.21",
|
|
57
57
|
"ts-json-schema-generator": "^1.0.0",
|
|
58
58
|
"typescript": "^4.6.4"
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"fast-xml-parser": "^4.0.7",
|
|
62
62
|
"json5": "^2.2.1",
|
|
63
|
-
"vscode-languageserver-
|
|
64
|
-
"vscode-languageserver-types": "=3.16.0"
|
|
63
|
+
"vscode-languageserver-types": "^3.17.1"
|
|
65
64
|
}
|
|
66
65
|
}
|