@abaplint/core 2.113.110 → 2.113.111
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 +3 -56
- package/build/src/abap/2_statements/expressions/component_name.js +1 -1
- package/build/src/abap/2_statements/expressions/namespace_simple_name.js +1 -1
- package/build/src/abap/5_syntax/expressions/method_parameters.js +1 -1
- package/build/src/abap/5_syntax/statements/selectoption.js +2 -0
- package/build/src/index.js +2 -9
- package/build/src/objects/rename/renamer_helper.js +3 -3
- package/build/src/registry.js +1 -1
- package/build/src/rules/exit_or_check.js +1 -1
- package/package.json +6 -6
package/build/abaplint.d.ts
CHANGED
|
@@ -2612,48 +2612,6 @@ declare class FloatType extends AbstractType {
|
|
|
2612
2612
|
toCDS(): string;
|
|
2613
2613
|
}
|
|
2614
2614
|
|
|
2615
|
-
export declare enum FLOW_EDGE_TYPE {
|
|
2616
|
-
true = "true",
|
|
2617
|
-
false = "false",
|
|
2618
|
-
undefined = "undefined"
|
|
2619
|
-
}
|
|
2620
|
-
|
|
2621
|
-
export declare class FlowGraph {
|
|
2622
|
-
private edges;
|
|
2623
|
-
private readonly startNode;
|
|
2624
|
-
private readonly endNode;
|
|
2625
|
-
private label;
|
|
2626
|
-
constructor(counter: number);
|
|
2627
|
-
getStart(): string;
|
|
2628
|
-
getLabel(): string;
|
|
2629
|
-
getEnd(): string;
|
|
2630
|
-
addEdge(from: string, to: string, type: FLOW_EDGE_TYPE): void;
|
|
2631
|
-
removeEdge(from: string, to: string): void;
|
|
2632
|
-
listEdges(): {
|
|
2633
|
-
from: string;
|
|
2634
|
-
to: string;
|
|
2635
|
-
type: FLOW_EDGE_TYPE;
|
|
2636
|
-
}[];
|
|
2637
|
-
listNodes(): string[];
|
|
2638
|
-
private hasEdges;
|
|
2639
|
-
/** return value: end node of to graph */
|
|
2640
|
-
addGraph(from: string, to: FlowGraph, type: FLOW_EDGE_TYPE): string;
|
|
2641
|
-
toJSON(): string;
|
|
2642
|
-
toTextEdges(): string;
|
|
2643
|
-
setLabel(label: string): void;
|
|
2644
|
-
toDigraph(): string;
|
|
2645
|
-
listSources(node: string): {
|
|
2646
|
-
name: string;
|
|
2647
|
-
type: FLOW_EDGE_TYPE;
|
|
2648
|
-
}[];
|
|
2649
|
-
listTargets(node: string): {
|
|
2650
|
-
name: string;
|
|
2651
|
-
type: FLOW_EDGE_TYPE;
|
|
2652
|
-
}[];
|
|
2653
|
-
/** removes all nodes containing "#" that have one in-going and one out-going edge */
|
|
2654
|
-
reduce(): this;
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
2615
|
declare class For extends Expression {
|
|
2658
2616
|
getRunnable(): IStatementRunnable;
|
|
2659
2617
|
}
|
|
@@ -3821,14 +3779,14 @@ declare interface IRange {
|
|
|
3821
3779
|
end: Position;
|
|
3822
3780
|
}
|
|
3823
3781
|
|
|
3824
|
-
|
|
3782
|
+
declare interface IReference {
|
|
3825
3783
|
position: Identifier;
|
|
3826
3784
|
resolved: Identifier | undefined;
|
|
3827
3785
|
referenceType: ReferenceType;
|
|
3828
3786
|
extra?: IReferenceExtras;
|
|
3829
3787
|
}
|
|
3830
3788
|
|
|
3831
|
-
|
|
3789
|
+
declare interface IReferenceExtras {
|
|
3832
3790
|
ooName?: string;
|
|
3833
3791
|
ooType?: "CLAS" | "INTF" | "Void";
|
|
3834
3792
|
}
|
|
@@ -5459,7 +5417,7 @@ declare class ReduceNext extends Expression {
|
|
|
5459
5417
|
getRunnable(): IStatementRunnable;
|
|
5460
5418
|
}
|
|
5461
5419
|
|
|
5462
|
-
|
|
5420
|
+
declare enum ReferenceType {
|
|
5463
5421
|
/** for classes and interface references */
|
|
5464
5422
|
ObjectOrientedReference = "Object",
|
|
5465
5423
|
ObjectOrientedVoidReference = "Object (Void)",
|
|
@@ -6196,17 +6154,6 @@ declare class StartOfSelection implements IStatement {
|
|
|
6196
6154
|
getMatcher(): IStatementRunnable;
|
|
6197
6155
|
}
|
|
6198
6156
|
|
|
6199
|
-
export declare class StatementFlow {
|
|
6200
|
-
private counter;
|
|
6201
|
-
build(stru: StructureNode, obj: IObject): FlowGraph[];
|
|
6202
|
-
private runEvent;
|
|
6203
|
-
private run;
|
|
6204
|
-
private findBody;
|
|
6205
|
-
static buildName(statement: StatementNode): string;
|
|
6206
|
-
private traverseBody;
|
|
6207
|
-
private traverseStructure;
|
|
6208
|
-
}
|
|
6209
|
-
|
|
6210
6157
|
declare class StatementNode extends AbstractNode<ExpressionNode | TokenNode> {
|
|
6211
6158
|
private readonly statement;
|
|
6212
6159
|
private readonly colon;
|
|
@@ -4,7 +4,7 @@ exports.ComponentName = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
class ComponentName extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.regex)(
|
|
7
|
+
return (0, combi_1.regex)(/^\w*(\/\w+\/)*[\w\d_%$\*\~]+$/);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.ComponentName = ComponentName;
|
|
@@ -4,7 +4,7 @@ exports.NamespaceSimpleName = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
class NamespaceSimpleName extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.regex)(/^!?((\w*\/\w+\/)|(\w*\/\w+\/)
|
|
7
|
+
return (0, combi_1.regex)(/^!?((\w*\/\w+\/)|(\w*\/\w+\/)*[\w\*$%#]+)$/);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NamespaceSimpleName = NamespaceSimpleName;
|
|
@@ -164,7 +164,7 @@ class MethodParameters {
|
|
|
164
164
|
if (parameter === undefined) {
|
|
165
165
|
const message = "Method importing parameter \"" + item.name + "\" does not exist";
|
|
166
166
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
167
|
-
|
|
167
|
+
continue;
|
|
168
168
|
}
|
|
169
169
|
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(item.sourceType, parameter.getType(), calculated) === false) {
|
|
170
170
|
const message = "Method parameter type not compatible, " + item.name;
|
|
@@ -22,6 +22,8 @@ class SelectOption {
|
|
|
22
22
|
}
|
|
23
23
|
for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
24
24
|
new dynamic_1.Dynamic().runSyntax(d, input);
|
|
25
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.VoidType("DYNAMIC_SELECT_OPTION")));
|
|
26
|
+
return;
|
|
25
27
|
}
|
|
26
28
|
const nameExpression = node.findFirstExpression(Expressions.FieldChain);
|
|
27
29
|
let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
|
package/build/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics =
|
|
3
|
+
exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
|
|
4
|
+
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = void 0;
|
|
5
5
|
const issue_1 = require("./issue");
|
|
6
6
|
Object.defineProperty(exports, "Issue", { enumerable: true, get: function () { return issue_1.Issue; } });
|
|
7
7
|
const config_1 = require("./config");
|
|
@@ -75,8 +75,6 @@ Object.defineProperty(exports, "NativeSQL", { enumerable: true, get: function ()
|
|
|
75
75
|
const edit_helper_1 = require("./edit_helper");
|
|
76
76
|
Object.defineProperty(exports, "applyEditSingle", { enumerable: true, get: function () { return edit_helper_1.applyEditSingle; } });
|
|
77
77
|
Object.defineProperty(exports, "applyEditList", { enumerable: true, get: function () { return edit_helper_1.applyEditList; } });
|
|
78
|
-
const _reference_1 = require("./abap/5_syntax/_reference");
|
|
79
|
-
Object.defineProperty(exports, "ReferenceType", { enumerable: true, get: function () { return _reference_1.ReferenceType; } });
|
|
80
78
|
const _builtin_1 = require("./abap/5_syntax/_builtin");
|
|
81
79
|
Object.defineProperty(exports, "BuiltIn", { enumerable: true, get: function () { return _builtin_1.BuiltIn; } });
|
|
82
80
|
const abap_file_1 = require("./abap/abap_file");
|
|
@@ -109,9 +107,4 @@ const diagnostics_1 = require("./lsp/diagnostics");
|
|
|
109
107
|
Object.defineProperty(exports, "Diagnostics", { enumerable: true, get: function () { return diagnostics_1.Diagnostics; } });
|
|
110
108
|
const _edit_1 = require("./lsp/_edit");
|
|
111
109
|
Object.defineProperty(exports, "LSPEdit", { enumerable: true, get: function () { return _edit_1.LSPEdit; } });
|
|
112
|
-
const statement_flow_1 = require("./abap/flow/statement_flow");
|
|
113
|
-
Object.defineProperty(exports, "StatementFlow", { enumerable: true, get: function () { return statement_flow_1.StatementFlow; } });
|
|
114
|
-
const flow_graph_1 = require("./abap/flow/flow_graph");
|
|
115
|
-
Object.defineProperty(exports, "FlowGraph", { enumerable: true, get: function () { return flow_graph_1.FlowGraph; } });
|
|
116
|
-
Object.defineProperty(exports, "FLOW_EDGE_TYPE", { enumerable: true, get: function () { return flow_graph_1.FLOW_EDGE_TYPE; } });
|
|
117
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RenamerHelper = void 0;
|
|
4
4
|
const vscode_languageserver_types_1 = require("vscode-languageserver-types");
|
|
5
|
-
const __1 = require("../..");
|
|
6
5
|
const syntax_1 = require("../../abap/5_syntax/syntax");
|
|
7
6
|
const _scope_type_1 = require("../../abap/5_syntax/_scope_type");
|
|
8
7
|
const virtual_position_1 = require("../../virtual_position");
|
|
9
8
|
const _abap_object_1 = require("../_abap_object");
|
|
9
|
+
const _reference_1 = require("../../abap/5_syntax/_reference");
|
|
10
10
|
class RenamerHelper {
|
|
11
11
|
constructor(reg) {
|
|
12
12
|
this.reg = reg;
|
|
@@ -147,11 +147,11 @@ class RenamerHelper {
|
|
|
147
147
|
let ret = [];
|
|
148
148
|
if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {
|
|
149
149
|
for (const r of node.getData().references) {
|
|
150
|
-
if (r.referenceType ===
|
|
150
|
+
if (r.referenceType === _reference_1.ReferenceType.ConstructorReference) {
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
153
|
if (((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.equals(identifier))
|
|
154
|
-
&& r.referenceType !==
|
|
154
|
+
&& r.referenceType !== _reference_1.ReferenceType.InferredType
|
|
155
155
|
&& !(r.position.getStart() instanceof virtual_position_1.VirtualPosition)) {
|
|
156
156
|
ret.push(r.position);
|
|
157
157
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -59,7 +59,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-re
|
|
|
59
59
|
else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {
|
|
60
60
|
const message = "CHECK is not allowed outside of loops";
|
|
61
61
|
let tokensString = statement.concatTokens();
|
|
62
|
-
tokensString = tokensString.
|
|
62
|
+
tokensString = tokensString.split("CHECK")[1].trim();
|
|
63
63
|
const replacement = "IF NOT " + tokensString + "\n RETURN.\nENDIF.";
|
|
64
64
|
const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);
|
|
65
65
|
const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.111",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.52.
|
|
53
|
+
"@microsoft/api-extractor": "^7.52.7",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^22.
|
|
56
|
+
"@types/node": "^22.15.17",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^9.
|
|
59
|
-
"mocha": "^11.
|
|
58
|
+
"eslint": "^9.26.0",
|
|
59
|
+
"mocha": "^11.2.2",
|
|
60
60
|
"c8": "^10.1.3",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
62
|
"ts-json-schema-generator": "^2.4.0",
|
|
63
63
|
"typescript": "^5.8.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^5.2.
|
|
66
|
+
"fast-xml-parser": "^5.2.3",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|