@abaplint/core 2.101.9 → 2.101.10
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/3_structures/structure_parser.js +1 -1
- package/build/src/abap/4_file_information/_abap_file_information.js +4 -4
- package/build/src/abap/4_file_information/visibility.js +1 -1
- package/build/src/abap/5_syntax/_builtin.js +1 -1
- package/build/src/abap/5_syntax/_reference.js +1 -1
- package/build/src/abap/5_syntax/_scope_type.js +1 -1
- package/build/src/abap/types/basic/table_type.js +2 -2
- package/build/src/abap/types/function_module_definition.js +1 -1
- package/build/src/ddl/ddl_parser.js +1 -1
- package/build/src/lsp/rename.js +10 -5
- package/build/src/lsp/semantic.js +1 -1
- package/build/src/objects/class.js +1 -1
- package/build/src/objects/table.js +2 -2
- package/build/src/registry.js +1 -1
- package/build/src/rules/_irule.js +1 -1
- package/build/src/rules/downport.js +10 -3
- package/build/src/rules/empty_structure.js +13 -13
- package/build/src/rules/keyword_case.js +1 -1
- package/build/src/rules/newline_between_methods.js +1 -1
- package/build/src/severity.js +1 -1
- package/build/src/version.js +1 -1
- package/package.json +2 -2
|
@@ -7,24 +7,24 @@ var AttributeLevel;
|
|
|
7
7
|
AttributeLevel["Instance"] = "instance";
|
|
8
8
|
AttributeLevel["Static"] = "static";
|
|
9
9
|
AttributeLevel["Constant"] = "constant";
|
|
10
|
-
})(AttributeLevel
|
|
10
|
+
})(AttributeLevel || (exports.AttributeLevel = AttributeLevel = {}));
|
|
11
11
|
var MethodParameterDirection;
|
|
12
12
|
(function (MethodParameterDirection) {
|
|
13
13
|
MethodParameterDirection["Importing"] = "importing";
|
|
14
14
|
MethodParameterDirection["Exporting"] = "exporting";
|
|
15
15
|
MethodParameterDirection["Changing"] = "changing";
|
|
16
16
|
MethodParameterDirection["Returning"] = "returning";
|
|
17
|
-
})(MethodParameterDirection
|
|
17
|
+
})(MethodParameterDirection || (exports.MethodParameterDirection = MethodParameterDirection = {}));
|
|
18
18
|
var Duration;
|
|
19
19
|
(function (Duration) {
|
|
20
20
|
Duration["short"] = "SHORT";
|
|
21
21
|
Duration["medium"] = "MEDIUM";
|
|
22
22
|
Duration["long"] = "LONG";
|
|
23
|
-
})(Duration
|
|
23
|
+
})(Duration || (exports.Duration = Duration = {}));
|
|
24
24
|
var RiskLevel;
|
|
25
25
|
(function (RiskLevel) {
|
|
26
26
|
RiskLevel["harmless"] = "HARMLESS";
|
|
27
27
|
RiskLevel["critical"] = "CRITICAL";
|
|
28
28
|
RiskLevel["dangerous"] = "DANGEROUS";
|
|
29
|
-
})(RiskLevel
|
|
29
|
+
})(RiskLevel || (exports.RiskLevel = RiskLevel = {}));
|
|
30
30
|
//# sourceMappingURL=_abap_file_information.js.map
|
|
@@ -6,5 +6,5 @@ var Visibility;
|
|
|
6
6
|
Visibility[Visibility["Private"] = 1] = "Private";
|
|
7
7
|
Visibility[Visibility["Protected"] = 2] = "Protected";
|
|
8
8
|
Visibility[Visibility["Public"] = 3] = "Public";
|
|
9
|
-
})(Visibility
|
|
9
|
+
})(Visibility || (exports.Visibility = Visibility = {}));
|
|
10
10
|
//# sourceMappingURL=visibility.js.map
|
|
@@ -354,6 +354,7 @@ class BuiltIn {
|
|
|
354
354
|
return new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, new basic_1.VoidType(name), ["built-in" /* IdentifierMeta.BuiltIn */]);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
+
exports.BuiltIn = BuiltIn;
|
|
357
358
|
BuiltIn.filename = "_builtin.prog.abap";
|
|
358
359
|
// todo: "pcre" vs "regex", only one of these parameters are allowed
|
|
359
360
|
// todo: "pcre", only possible from 755
|
|
@@ -1177,5 +1178,4 @@ BuiltIn.methods = [
|
|
|
1177
1178
|
return: new basic_1.IntegerType(),
|
|
1178
1179
|
},
|
|
1179
1180
|
];
|
|
1180
|
-
exports.BuiltIn = BuiltIn;
|
|
1181
1181
|
//# sourceMappingURL=_builtin.js.map
|
|
@@ -20,5 +20,5 @@ var ReferenceType;
|
|
|
20
20
|
// FormVoidReference = "Form (void)",
|
|
21
21
|
ReferenceType["DataReadReference"] = "Read From";
|
|
22
22
|
ReferenceType["DataWriteReference"] = "Write To";
|
|
23
|
-
})(ReferenceType
|
|
23
|
+
})(ReferenceType || (exports.ReferenceType = ReferenceType = {}));
|
|
24
24
|
//# sourceMappingURL=_reference.js.map
|
|
@@ -19,5 +19,5 @@ var ScopeType;
|
|
|
19
19
|
ScopeType["For"] = "for";
|
|
20
20
|
ScopeType["Let"] = "let";
|
|
21
21
|
ScopeType["OpenSQL"] = "open_sql";
|
|
22
|
-
})(ScopeType
|
|
22
|
+
})(ScopeType || (exports.ScopeType = ScopeType = {}));
|
|
23
23
|
//# sourceMappingURL=_scope_type.js.map
|
|
@@ -9,13 +9,13 @@ var TableAccessType;
|
|
|
9
9
|
TableAccessType["hashed"] = "HASHED";
|
|
10
10
|
TableAccessType["index"] = "INDEX";
|
|
11
11
|
TableAccessType["any"] = "ANY";
|
|
12
|
-
})(TableAccessType
|
|
12
|
+
})(TableAccessType || (exports.TableAccessType = TableAccessType = {}));
|
|
13
13
|
var TableKeyType;
|
|
14
14
|
(function (TableKeyType) {
|
|
15
15
|
TableKeyType["default"] = "DEFAULT";
|
|
16
16
|
TableKeyType["user"] = "USER";
|
|
17
17
|
TableKeyType["empty"] = "EMPTY";
|
|
18
|
-
})(TableKeyType
|
|
18
|
+
})(TableKeyType || (exports.TableKeyType = TableKeyType = {}));
|
|
19
19
|
class TableType extends _abstract_type_1.AbstractType {
|
|
20
20
|
constructor(rowType, options, qualifiedName) {
|
|
21
21
|
var _a;
|
|
@@ -8,7 +8,7 @@ var FunctionModuleParameterDirection;
|
|
|
8
8
|
FunctionModuleParameterDirection["exporting"] = "exporting";
|
|
9
9
|
FunctionModuleParameterDirection["changing"] = "changing";
|
|
10
10
|
FunctionModuleParameterDirection["tables"] = "tables";
|
|
11
|
-
})(FunctionModuleParameterDirection
|
|
11
|
+
})(FunctionModuleParameterDirection || (exports.FunctionModuleParameterDirection = FunctionModuleParameterDirection = {}));
|
|
12
12
|
class FunctionModuleDefinition {
|
|
13
13
|
constructor(data) {
|
|
14
14
|
this.parse(data);
|
|
@@ -10,7 +10,7 @@ var DDLKind;
|
|
|
10
10
|
(function (DDLKind) {
|
|
11
11
|
DDLKind["Structure"] = "structure";
|
|
12
12
|
DDLKind["Table"] = "table";
|
|
13
|
-
})(DDLKind
|
|
13
|
+
})(DDLKind || (exports.DDLKind = DDLKind = {}));
|
|
14
14
|
class DDLParser {
|
|
15
15
|
parse(file) {
|
|
16
16
|
const tokens = ddl_lexer_1.DDLLexer.run(file);
|
package/build/src/lsp/rename.js
CHANGED
|
@@ -16,7 +16,7 @@ var RenameType;
|
|
|
16
16
|
RenameType[RenameType["Variable"] = 2] = "Variable";
|
|
17
17
|
RenameType[RenameType["GlobalInterface"] = 3] = "GlobalInterface";
|
|
18
18
|
RenameType[RenameType["Method"] = 4] = "Method";
|
|
19
|
-
})(RenameType
|
|
19
|
+
})(RenameType || (exports.RenameType = RenameType = {}));
|
|
20
20
|
class Rename {
|
|
21
21
|
constructor(reg) {
|
|
22
22
|
this.reg = reg;
|
|
@@ -35,18 +35,23 @@ class Rename {
|
|
|
35
35
|
return undefined;
|
|
36
36
|
}
|
|
37
37
|
const range = _lsp_utils_1.LSPUtils.tokenToRange(cursor.token);
|
|
38
|
+
let placeholder = cursor.token.getStr();
|
|
39
|
+
if (placeholder.startsWith("!")) {
|
|
40
|
+
placeholder = placeholder.substring(1);
|
|
41
|
+
range.start.character += 1;
|
|
42
|
+
}
|
|
38
43
|
const lookup = _lookup_1.LSPLookup.lookup(cursor, this.reg, obj);
|
|
39
44
|
if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof _typed_identifier_1.TypedIdentifier) {
|
|
40
|
-
return { range, placeholder
|
|
45
|
+
return { range, placeholder, type: RenameType.Variable, file };
|
|
41
46
|
}
|
|
42
47
|
else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.ClassDefinition) {
|
|
43
|
-
return { range, placeholder
|
|
48
|
+
return { range, placeholder, type: RenameType.GlobalClass, file };
|
|
44
49
|
}
|
|
45
50
|
else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.InterfaceDefinition) {
|
|
46
|
-
return { range, placeholder
|
|
51
|
+
return { range, placeholder, type: RenameType.GlobalInterface, file };
|
|
47
52
|
}
|
|
48
53
|
else if ((lookup === null || lookup === void 0 ? void 0 : lookup.definitionId) instanceof types_1.MethodDefinition) {
|
|
49
|
-
return { range, placeholder
|
|
54
|
+
return { range, placeholder, type: RenameType.Method, file };
|
|
50
55
|
}
|
|
51
56
|
return undefined;
|
|
52
57
|
}
|
|
@@ -9,7 +9,7 @@ var ClassCategory;
|
|
|
9
9
|
ClassCategory["PersistentFactory"] = "11";
|
|
10
10
|
ClassCategory["Exception"] = "40";
|
|
11
11
|
ClassCategory["SharedObject"] = "45";
|
|
12
|
-
})(ClassCategory
|
|
12
|
+
})(ClassCategory || (exports.ClassCategory = ClassCategory = {}));
|
|
13
13
|
class Class extends _abap_object_1.ABAPObject {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -15,7 +15,7 @@ var EnhancementCategory;
|
|
|
15
15
|
EnhancementCategory["Character"] = "2";
|
|
16
16
|
EnhancementCategory["CharacterOrNumeric"] = "3";
|
|
17
17
|
EnhancementCategory["Deep"] = "4";
|
|
18
|
-
})(EnhancementCategory
|
|
18
|
+
})(EnhancementCategory || (exports.EnhancementCategory = EnhancementCategory = {}));
|
|
19
19
|
var TableCategory;
|
|
20
20
|
(function (TableCategory) {
|
|
21
21
|
TableCategory["Transparent"] = "TRANSP";
|
|
@@ -24,7 +24,7 @@ var TableCategory;
|
|
|
24
24
|
TableCategory["Pooled"] = "POOL";
|
|
25
25
|
TableCategory["View"] = "VIEW";
|
|
26
26
|
TableCategory["Append"] = "APPEND";
|
|
27
|
-
})(TableCategory
|
|
27
|
+
})(TableCategory || (exports.TableCategory = TableCategory = {}));
|
|
28
28
|
class Table extends _abstract_object_1.AbstractObject {
|
|
29
29
|
getType() {
|
|
30
30
|
return "TABL";
|
package/build/src/registry.js
CHANGED
|
@@ -17,5 +17,5 @@ var RuleTag;
|
|
|
17
17
|
RuleTag["Styleguide"] = "Styleguide";
|
|
18
18
|
/** Single file compatible, the rule gives correct results when having only information about the single file */
|
|
19
19
|
RuleTag["SingleFile"] = "SingleFile";
|
|
20
|
-
})(RuleTag
|
|
20
|
+
})(RuleTag || (exports.RuleTag = RuleTag = {}));
|
|
21
21
|
//# sourceMappingURL=_irule.js.map
|
|
@@ -2672,9 +2672,16 @@ ${indentation} output = ${topTarget}.`;
|
|
|
2672
2672
|
const data = `DATA ${name} TYPE REF TO ${type}.\n` +
|
|
2673
2673
|
indentation + abap + "\n" +
|
|
2674
2674
|
indentation;
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2675
|
+
if (found.getFirstToken().getStart().equals(high.getFirstToken().getStart())
|
|
2676
|
+
&& found.getLastToken().getEnd().equals(high.getLastToken().getStart())) {
|
|
2677
|
+
// full statement = standalone NEW expression
|
|
2678
|
+
fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), abap);
|
|
2679
|
+
}
|
|
2680
|
+
else {
|
|
2681
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), data);
|
|
2682
|
+
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);
|
|
2683
|
+
fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
2684
|
+
}
|
|
2678
2685
|
}
|
|
2679
2686
|
if (fix) {
|
|
2680
2687
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Use CREATE OBJECT instead of NEW", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -62,24 +62,24 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
62
62
|
}
|
|
63
63
|
const candidates = [];
|
|
64
64
|
if (this.getConfig().loop === true) {
|
|
65
|
-
candidates.push(...stru.
|
|
65
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.Loop));
|
|
66
66
|
}
|
|
67
67
|
if (this.getConfig().while === true) {
|
|
68
|
-
candidates.push(...stru.
|
|
68
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.While));
|
|
69
69
|
}
|
|
70
70
|
if (this.getConfig().case === true) {
|
|
71
|
-
candidates.push(...stru.
|
|
71
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.Case));
|
|
72
72
|
}
|
|
73
73
|
if (this.getConfig().select === true) {
|
|
74
|
-
candidates.push(...stru.
|
|
74
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.Select));
|
|
75
75
|
}
|
|
76
76
|
if (this.getConfig().do === true) {
|
|
77
|
-
candidates.push(...stru.
|
|
77
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.Do));
|
|
78
78
|
}
|
|
79
79
|
if (this.getConfig().at === true) {
|
|
80
|
-
candidates.push(...stru.
|
|
81
|
-
candidates.push(...stru.
|
|
82
|
-
candidates.push(...stru.
|
|
80
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.At));
|
|
81
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.AtFirst));
|
|
82
|
+
candidates.push(...stru.findAllStructuresRecursive(Structures.AtLast));
|
|
83
83
|
}
|
|
84
84
|
for (const l of candidates) {
|
|
85
85
|
if (l.getChildren().length === 2) {
|
|
@@ -89,7 +89,7 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
if (this.getConfig().try === true) {
|
|
92
|
-
const tries = stru.
|
|
92
|
+
const tries = stru.findAllStructuresRecursive(Structures.Try);
|
|
93
93
|
for (const t of tries) {
|
|
94
94
|
const normal = t.findDirectStructure(Structures.Body);
|
|
95
95
|
if (normal === undefined) {
|
|
@@ -100,9 +100,9 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
if (this.getConfig().if === true) {
|
|
103
|
-
const tries = stru.
|
|
104
|
-
.concat(stru.
|
|
105
|
-
.concat(stru.
|
|
103
|
+
const tries = stru.findAllStructuresRecursive(Structures.If)
|
|
104
|
+
.concat(stru.findAllStructuresRecursive(Structures.Else))
|
|
105
|
+
.concat(stru.findAllStructuresRecursive(Structures.ElseIf));
|
|
106
106
|
for (const t of tries) {
|
|
107
107
|
const normal = t.findDirectStructure(Structures.Body);
|
|
108
108
|
if (normal === undefined) {
|
|
@@ -113,7 +113,7 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
if (this.getConfig().when === true) {
|
|
116
|
-
const tries = stru.
|
|
116
|
+
const tries = stru.findAllStructuresRecursive(Structures.When);
|
|
117
117
|
for (const t of tries) {
|
|
118
118
|
if (t.getChildren().length === 1) {
|
|
119
119
|
const token = t.getFirstToken();
|
|
@@ -18,7 +18,7 @@ var KeywordCaseStyle;
|
|
|
18
18
|
(function (KeywordCaseStyle) {
|
|
19
19
|
KeywordCaseStyle["Upper"] = "upper";
|
|
20
20
|
KeywordCaseStyle["Lower"] = "lower";
|
|
21
|
-
})(KeywordCaseStyle
|
|
21
|
+
})(KeywordCaseStyle || (exports.KeywordCaseStyle = KeywordCaseStyle = {}));
|
|
22
22
|
class KeywordCaseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
23
23
|
constructor() {
|
|
24
24
|
super(...arguments);
|
|
@@ -11,7 +11,7 @@ var NewlineLogic;
|
|
|
11
11
|
(function (NewlineLogic) {
|
|
12
12
|
NewlineLogic["Exact"] = "exact";
|
|
13
13
|
NewlineLogic["Less"] = "less";
|
|
14
|
-
})(NewlineLogic
|
|
14
|
+
})(NewlineLogic || (exports.NewlineLogic = NewlineLogic = {}));
|
|
15
15
|
class NewlineBetweenMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
package/build/src/severity.js
CHANGED
package/build/src/version.js
CHANGED
|
@@ -18,7 +18,7 @@ var Version;
|
|
|
18
18
|
Version["v756"] = "v756";
|
|
19
19
|
Version["v757"] = "v757";
|
|
20
20
|
Version["Cloud"] = "Cloud";
|
|
21
|
-
})(Version
|
|
21
|
+
})(Version || (exports.Version = Version = {}));
|
|
22
22
|
exports.defaultVersion = Version.v757;
|
|
23
23
|
function getPreviousVersion(v) {
|
|
24
24
|
if (v === Version.OpenABAP) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.10",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"c8": "^7.14.0",
|
|
59
59
|
"source-map-support": "^0.5.21",
|
|
60
60
|
"ts-json-schema-generator": "^1.2.0",
|
|
61
|
-
"typescript": "^5.
|
|
61
|
+
"typescript": "^5.1.3"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"fast-xml-parser": "^4.2.2",
|