@abaplint/core 2.113.6 → 2.113.8
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/src/abap/5_syntax/_object_oriented.js +13 -0
- package/build/src/abap/5_syntax/expressions/method_call_chain.js +2 -5
- package/build/src/abap/5_syntax/expressions/method_source.js +1 -5
- package/build/src/registry.js +1 -1
- package/build/src/rules/line_only_punc.js +5 -2
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ exports.ObjectOriented = void 0;
|
|
|
4
4
|
const Statements = require("../2_statements/statements");
|
|
5
5
|
const Expressions = require("../2_statements/expressions");
|
|
6
6
|
const visibility_1 = require("../4_file_information/visibility");
|
|
7
|
+
const types_1 = require("../types");
|
|
7
8
|
// todo, think some of the public methods can be made private
|
|
8
9
|
// todo: changet this class to static? for performance
|
|
9
10
|
class ObjectOriented {
|
|
@@ -77,6 +78,18 @@ class ObjectOriented {
|
|
|
77
78
|
}
|
|
78
79
|
return undefined;
|
|
79
80
|
}
|
|
81
|
+
methodReferenceExtras(foundDef, ooName) {
|
|
82
|
+
if (foundDef === undefined) {
|
|
83
|
+
return {
|
|
84
|
+
ooName: ooName,
|
|
85
|
+
ooType: undefined,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),
|
|
90
|
+
ooType: foundDef instanceof types_1.ClassDefinition ? "CLAS" : "INTF",
|
|
91
|
+
};
|
|
92
|
+
}
|
|
80
93
|
findClassName(node) {
|
|
81
94
|
if (!(node.get() instanceof Statements.ClassImplementation
|
|
82
95
|
|| node.get() instanceof Statements.ClassDefinition)) {
|
|
@@ -13,7 +13,6 @@ const method_call_param_1 = require("./method_call_param");
|
|
|
13
13
|
const _reference_1 = require("../_reference");
|
|
14
14
|
const component_name_1 = require("./component_name");
|
|
15
15
|
const attribute_name_1 = require("./attribute_name");
|
|
16
|
-
const class_definition_1 = require("../../types/class_definition");
|
|
17
16
|
const _syntax_input_1 = require("../_syntax_input");
|
|
18
17
|
class MethodCallChain {
|
|
19
18
|
runSyntax(node, input, targetType) {
|
|
@@ -56,10 +55,8 @@ class MethodCallChain {
|
|
|
56
55
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, message));
|
|
57
56
|
return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
|
|
58
57
|
}
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
ooType: foundDef instanceof class_definition_1.ClassDefinition ? "CLAS" : "INTF"
|
|
62
|
-
};
|
|
58
|
+
const voidedName = context instanceof basic_1.VoidType ? context.getVoided() : undefined;
|
|
59
|
+
const extra = helper.methodReferenceExtras(foundDef, className || voidedName);
|
|
63
60
|
input.scope.addReference(methodToken, method, _reference_1.ReferenceType.MethodReference, input.filename, extra);
|
|
64
61
|
}
|
|
65
62
|
if (methodName === null || methodName === void 0 ? void 0 : methodName.includes("~")) {
|
|
@@ -13,7 +13,6 @@ const source_field_1 = require("./source_field");
|
|
|
13
13
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
14
14
|
const attribute_name_1 = require("./attribute_name");
|
|
15
15
|
const component_name_1 = require("./component_name");
|
|
16
|
-
const types_1 = require("../../types");
|
|
17
16
|
const version_1 = require("../../../version");
|
|
18
17
|
const _syntax_input_1 = require("../_syntax_input");
|
|
19
18
|
const assert_error_1 = require("../assert_error");
|
|
@@ -93,10 +92,7 @@ class MethodSource {
|
|
|
93
92
|
return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
|
|
94
93
|
}
|
|
95
94
|
else if (method) {
|
|
96
|
-
const extra =
|
|
97
|
-
ooName: foundDef === null || foundDef === void 0 ? void 0 : foundDef.getName(),
|
|
98
|
-
ooType: foundDef instanceof types_1.ClassDefinition ? "CLAS" : "INTF"
|
|
99
|
-
};
|
|
95
|
+
const extra = helper.methodReferenceExtras(foundDef, className);
|
|
100
96
|
input.scope.addReference(methodToken, method, _reference_1.ReferenceType.MethodReference, input.filename, extra);
|
|
101
97
|
context = method;
|
|
102
98
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -63,7 +63,7 @@ https://docs.abapopenchecks.org/checks/16/`,
|
|
|
63
63
|
const position = new position_1.Position(i + 1, column);
|
|
64
64
|
// merge punc into previous row
|
|
65
65
|
let rowContent = rows[i].trim();
|
|
66
|
-
// if reported row contains
|
|
66
|
+
// if reported row contains parentheses, prefix with space if needed
|
|
67
67
|
if (rowContent.length > 1 && !rows[i - 1].endsWith(" ") && !rows[i - 1].endsWith(" \r")) {
|
|
68
68
|
rowContent = " " + rowContent;
|
|
69
69
|
}
|
|
@@ -73,7 +73,10 @@ https://docs.abapopenchecks.org/checks/16/`,
|
|
|
73
73
|
}
|
|
74
74
|
const startPos = new position_1.Position(i, rows[i - 1].length + 1 + offset);
|
|
75
75
|
const endPos = new position_1.Position(i + 1, rows[i].length + 1);
|
|
76
|
-
|
|
76
|
+
let fix = edit_helper_1.EditHelper.replaceRange(file, startPos, endPos, rowContent);
|
|
77
|
+
if (rows[i - 1] === undefined || rows[i - 1].indexOf("*") === 0 || rows[i - 1].includes(`"`)) {
|
|
78
|
+
fix = undefined;
|
|
79
|
+
}
|
|
77
80
|
const issue = issue_1.Issue.atPosition(file, position, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
|
|
78
81
|
issues.push(issue);
|
|
79
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.8",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@types/mocha": "^10.0.7",
|
|
56
56
|
"@types/node": "^22.5.4",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.10.0",
|
|
59
59
|
"mocha": "^10.7.3",
|
|
60
60
|
"c8": "^10.1.2",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
62
|
"ts-json-schema-generator": "^2.3.0",
|
|
63
|
-
"typescript": "^5.
|
|
63
|
+
"typescript": "^5.6.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"fast-xml-parser": "^4.5.0",
|