@abaplint/cli 2.120.88 → 2.120.90
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/cli.js +147 -16
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -28511,6 +28511,15 @@ class TypeUtils {
|
|
|
28511
28511
|
}
|
|
28512
28512
|
return this.isAssignable(source, target);
|
|
28513
28513
|
}
|
|
28514
|
+
// character-like arguments of built-in functions must be elementary, flat character-like structures are not allowed
|
|
28515
|
+
isAssignableBuiltin(source, target, node) {
|
|
28516
|
+
if (target instanceof basic_1.CLikeType
|
|
28517
|
+
&& (source instanceof basic_1.StructureType
|
|
28518
|
+
|| (source instanceof basic_1.TableType && source.isWithHeader() && source.getRowType() instanceof basic_1.StructureType))) {
|
|
28519
|
+
return false;
|
|
28520
|
+
}
|
|
28521
|
+
return this.isAssignableStrict(source, target, node);
|
|
28522
|
+
}
|
|
28514
28523
|
// Typing with the classic STRUCTURE addition, ie. "FORM foo USING bar STRUCTURE zkey",
|
|
28515
28524
|
// is not a compatibility check: ABAP only checks the fragment view up to the end of the
|
|
28516
28525
|
// formal structure, so the actual parameter is allowed to be longer. For TABLES parameters
|
|
@@ -32143,6 +32152,7 @@ class FieldChain {
|
|
|
32143
32152
|
const children = node.getChildren();
|
|
32144
32153
|
context = this.findTop(children[0], input, refType);
|
|
32145
32154
|
let prev = children[0].concatTokens();
|
|
32155
|
+
let afterTableExpression = false;
|
|
32146
32156
|
for (let i = 1; i < children.length; i++) {
|
|
32147
32157
|
const current = children[i];
|
|
32148
32158
|
if (current === undefined) {
|
|
@@ -32190,6 +32200,9 @@ class FieldChain {
|
|
|
32190
32200
|
}
|
|
32191
32201
|
}
|
|
32192
32202
|
else if (current.get() instanceof tokens_1.InstanceArrow) {
|
|
32203
|
+
if (afterTableExpression && table_expression_1.TableExpression.checkArrowAfter(input, current.getFirstToken())) {
|
|
32204
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32205
|
+
}
|
|
32193
32206
|
if (!(context instanceof basic_1.ObjectReferenceType)
|
|
32194
32207
|
&& !(context instanceof basic_1.DataReference)
|
|
32195
32208
|
&& !(context instanceof basic_1.VoidType)) {
|
|
@@ -32222,6 +32235,7 @@ class FieldChain {
|
|
|
32222
32235
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32223
32236
|
}
|
|
32224
32237
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
32238
|
+
afterTableExpression = true;
|
|
32225
32239
|
if (!(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
|
|
32226
32240
|
context = context.getRowType();
|
|
32227
32241
|
}
|
|
@@ -33577,6 +33591,7 @@ const method_call_param_1 = __webpack_require__(/*! ./method_call_param */ "../c
|
|
|
33577
33591
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
33578
33592
|
const component_name_1 = __webpack_require__(/*! ./component_name */ "../core/build/src/abap/5_syntax/expressions/component_name.js");
|
|
33579
33593
|
const attribute_name_1 = __webpack_require__(/*! ./attribute_name */ "../core/build/src/abap/5_syntax/expressions/attribute_name.js");
|
|
33594
|
+
const table_expression_1 = __webpack_require__(/*! ./table_expression */ "../core/build/src/abap/5_syntax/expressions/table_expression.js");
|
|
33580
33595
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
33581
33596
|
class MethodCallChain {
|
|
33582
33597
|
static runSyntax(node, input, targetType) {
|
|
@@ -33589,6 +33604,13 @@ class MethodCallChain {
|
|
|
33589
33604
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
33590
33605
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33591
33606
|
}
|
|
33607
|
+
// the field chain is followed by "->", eg. "itab[ 1 ]-ref->meth( )"
|
|
33608
|
+
if (first instanceof nodes_1.ExpressionNode
|
|
33609
|
+
&& first.get() instanceof Expressions.FieldChain
|
|
33610
|
+
&& first.findDirectExpression(Expressions.TableExpression) !== undefined
|
|
33611
|
+
&& table_expression_1.TableExpression.checkArrowAfter(input, children[1].getFirstToken())) {
|
|
33612
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33613
|
+
}
|
|
33592
33614
|
let currentIndex = 1;
|
|
33593
33615
|
let context = this.findTop(first, input, targetType);
|
|
33594
33616
|
if (first.get() instanceof Expressions.MethodCall) {
|
|
@@ -33800,6 +33822,7 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/bui
|
|
|
33800
33822
|
const constant_1 = __webpack_require__(/*! ./constant */ "../core/build/src/abap/5_syntax/expressions/constant.js");
|
|
33801
33823
|
const _check_offset_length_1 = __webpack_require__(/*! ./_check_offset_length */ "../core/build/src/abap/5_syntax/expressions/_check_offset_length.js");
|
|
33802
33824
|
const _check_text_symbol_1 = __webpack_require__(/*! ./_check_text_symbol */ "../core/build/src/abap/5_syntax/expressions/_check_text_symbol.js");
|
|
33825
|
+
const _builtin_1 = __webpack_require__(/*! ../_builtin */ "../core/build/src/abap/5_syntax/_builtin.js");
|
|
33803
33826
|
class MethodCallParam {
|
|
33804
33827
|
/** returns the type of the unnamed argument, if any */
|
|
33805
33828
|
static runSyntax(node, input, method) {
|
|
@@ -33876,7 +33899,7 @@ class MethodCallParam {
|
|
|
33876
33899
|
else if ((0, _check_text_symbol_1.checkTextSymbol)(child, targetType, input)) {
|
|
33877
33900
|
return;
|
|
33878
33901
|
}
|
|
33879
|
-
else if (
|
|
33902
|
+
else if (this.isAssignable(sourceType, targetType, child, method, input) === false) {
|
|
33880
33903
|
const message = "Method parameter type not compatible";
|
|
33881
33904
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
33882
33905
|
return;
|
|
@@ -33896,6 +33919,12 @@ class MethodCallParam {
|
|
|
33896
33919
|
}
|
|
33897
33920
|
return undefined;
|
|
33898
33921
|
}
|
|
33922
|
+
static isAssignable(sourceType, targetType, child, method, input) {
|
|
33923
|
+
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
33924
|
+
return method instanceof _builtin_1.BuiltInMethod
|
|
33925
|
+
? typeUtils.isAssignableBuiltin(sourceType, targetType, child)
|
|
33926
|
+
: typeUtils.isAssignableStrict(sourceType, targetType, child);
|
|
33927
|
+
}
|
|
33899
33928
|
}
|
|
33900
33929
|
exports.MethodCallParam = MethodCallParam;
|
|
33901
33930
|
//# sourceMappingURL=method_call_param.js.map
|
|
@@ -34133,6 +34162,7 @@ const field_chain_1 = __webpack_require__(/*! ./field_chain */ "../core/build/sr
|
|
|
34133
34162
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
34134
34163
|
const _check_offset_length_1 = __webpack_require__(/*! ./_check_offset_length */ "../core/build/src/abap/5_syntax/expressions/_check_offset_length.js");
|
|
34135
34164
|
const _check_text_symbol_1 = __webpack_require__(/*! ./_check_text_symbol */ "../core/build/src/abap/5_syntax/expressions/_check_text_symbol.js");
|
|
34165
|
+
const _builtin_1 = __webpack_require__(/*! ../_builtin */ "../core/build/src/abap/5_syntax/_builtin.js");
|
|
34136
34166
|
function normalizeParameterName(name) {
|
|
34137
34167
|
return name.replace(/^!/, "").toUpperCase();
|
|
34138
34168
|
}
|
|
@@ -34280,6 +34310,10 @@ class MethodParameters {
|
|
|
34280
34310
|
if (this.requiredParameters === undefined) {
|
|
34281
34311
|
this.requiredParameters = new Set(method.getParameters().getRequiredParameters().map(i => i.getName().toUpperCase()));
|
|
34282
34312
|
}
|
|
34313
|
+
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
34314
|
+
const assignable = method instanceof _builtin_1.BuiltInMethod
|
|
34315
|
+
? typeUtils.isAssignableBuiltin.bind(typeUtils)
|
|
34316
|
+
: typeUtils.isAssignableStrict.bind(typeUtils);
|
|
34283
34317
|
for (const item of items) {
|
|
34284
34318
|
const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
|
|
34285
34319
|
if (parameter === undefined) {
|
|
@@ -34290,7 +34324,7 @@ class MethodParameters {
|
|
|
34290
34324
|
else if ((0, _check_text_symbol_1.checkTextSymbol)(item.source, parameter.getType(), input)) {
|
|
34291
34325
|
return;
|
|
34292
34326
|
}
|
|
34293
|
-
else if (
|
|
34327
|
+
else if (assignable(item.sourceType, parameter.getType(), item.source) === false) {
|
|
34294
34328
|
const message = "Method parameter type not compatible, " + item.name;
|
|
34295
34329
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
34296
34330
|
return;
|
|
@@ -36986,9 +37020,23 @@ exports.TableExpression = void 0;
|
|
|
36986
37020
|
const nodes_1 = __webpack_require__(/*! ../../nodes */ "../core/build/src/abap/nodes/index.js");
|
|
36987
37021
|
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
36988
37022
|
const source_1 = __webpack_require__(/*! ./source */ "../core/build/src/abap/5_syntax/expressions/source.js");
|
|
37023
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
36989
37024
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
36990
37025
|
const component_chain_1 = __webpack_require__(/*! ./component_chain */ "../core/build/src/abap/5_syntax/expressions/component_chain.js");
|
|
37026
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
36991
37027
|
class TableExpression {
|
|
37028
|
+
/** below v750 the object component selector "->" cannot follow a table expression, eg. "itab[ 1 ]-ref->meth( )",
|
|
37029
|
+
* returns true and adds an issue if not allowed */
|
|
37030
|
+
static checkArrowAfter(input, arrow) {
|
|
37031
|
+
if ((0, version_1.releaseAtLeast)(input.scope.getRelease(), version_1.Release.v750)
|
|
37032
|
+
|| input.scope.getLanguageVersion() === version_1.LanguageVersion.Cloud
|
|
37033
|
+
|| input.scope.getOpenABAP()) {
|
|
37034
|
+
return false;
|
|
37035
|
+
}
|
|
37036
|
+
const message = "Object component selector \"->\" after table expression not possible below v750";
|
|
37037
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, arrow, message));
|
|
37038
|
+
return true;
|
|
37039
|
+
}
|
|
36992
37040
|
static runSyntax(node, input, rowType) {
|
|
36993
37041
|
if (node === undefined) {
|
|
36994
37042
|
return;
|
|
@@ -37105,6 +37153,7 @@ class Target {
|
|
|
37105
37153
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
37106
37154
|
}
|
|
37107
37155
|
let currentIndex = 1;
|
|
37156
|
+
let afterTableExpression = false;
|
|
37108
37157
|
while (currentIndex <= children.length) {
|
|
37109
37158
|
const current = children[currentIndex];
|
|
37110
37159
|
if (current === undefined) {
|
|
@@ -37130,6 +37179,9 @@ class Target {
|
|
|
37130
37179
|
}
|
|
37131
37180
|
}
|
|
37132
37181
|
else if (current.get() instanceof tokens_1.InstanceArrow) {
|
|
37182
|
+
if (afterTableExpression && table_expression_1.TableExpression.checkArrowAfter(input, current.getFirstToken())) {
|
|
37183
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
37184
|
+
}
|
|
37133
37185
|
if (!(context instanceof basic_1.ObjectReferenceType)
|
|
37134
37186
|
&& !(context instanceof basic_1.DataReference)
|
|
37135
37187
|
&& !(context instanceof basic_1.VoidType)) {
|
|
@@ -37178,6 +37230,7 @@ class Target {
|
|
|
37178
37230
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
37179
37231
|
}
|
|
37180
37232
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
37233
|
+
afterTableExpression = true;
|
|
37181
37234
|
if (!(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
|
|
37182
37235
|
context = context.getRowType();
|
|
37183
37236
|
}
|
|
@@ -56693,7 +56746,7 @@ const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "../core/build/sr
|
|
|
56693
56746
|
const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
|
|
56694
56747
|
class CDSDetermineTypes {
|
|
56695
56748
|
parseType(reg, parsedData, ddlsName) {
|
|
56696
|
-
var _a;
|
|
56749
|
+
var _a, _b;
|
|
56697
56750
|
const ddic = new ddic_1.DDIC(reg);
|
|
56698
56751
|
if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
|
|
56699
56752
|
return basic_1.VoidType.get("DDLS:todo");
|
|
@@ -56772,13 +56825,29 @@ class CDSDetermineTypes {
|
|
|
56772
56825
|
else {
|
|
56773
56826
|
components.push({
|
|
56774
56827
|
name: f.name,
|
|
56775
|
-
type: basic_1.VoidType.get("DDLS:fieldname:" + ddlsName),
|
|
56828
|
+
type: (_b = this.findInSources(ddic, parsedData, f.nameInSource)) !== null && _b !== void 0 ? _b : basic_1.VoidType.get("DDLS:fieldname:" + ddlsName),
|
|
56776
56829
|
});
|
|
56777
56830
|
}
|
|
56778
56831
|
}
|
|
56779
56832
|
return new basic_1.StructureType(components, parsedData.definitionName, parsedData.definitionName, parsedData.description);
|
|
56780
56833
|
}
|
|
56781
56834
|
}
|
|
56835
|
+
/** unprefixed field, take the type from the first source containing it, void or unknown sources are skipped */
|
|
56836
|
+
findInSources(ddic, parsedData, nameInSource) {
|
|
56837
|
+
if (nameInSource === undefined) {
|
|
56838
|
+
return undefined;
|
|
56839
|
+
}
|
|
56840
|
+
for (const source of parsedData.sources) {
|
|
56841
|
+
const lookup = ddic.lookupTableOrView(source.name);
|
|
56842
|
+
if (lookup.type instanceof basic_1.StructureType) {
|
|
56843
|
+
const type = lookup.type.getComponentByName(nameInSource);
|
|
56844
|
+
if (type) {
|
|
56845
|
+
return type;
|
|
56846
|
+
}
|
|
56847
|
+
}
|
|
56848
|
+
}
|
|
56849
|
+
return undefined;
|
|
56850
|
+
}
|
|
56782
56851
|
}
|
|
56783
56852
|
exports.CDSDetermineTypes = CDSDetermineTypes;
|
|
56784
56853
|
//# sourceMappingURL=cds_determine_types.js.map
|
|
@@ -65344,8 +65413,12 @@ exports.DataControl = DataControl;
|
|
|
65344
65413
|
|
|
65345
65414
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
65346
65415
|
exports.DataDefinition = void 0;
|
|
65416
|
+
const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "../core/build/src/abap/1_lexer/tokens/index.js");
|
|
65417
|
+
const combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ "../core/build/src/abap/2_statements/combi.js");
|
|
65347
65418
|
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "../core/build/src/abap/nodes/index.js");
|
|
65348
65419
|
const cds_determine_types_1 = __webpack_require__(/*! ../cds/cds_determine_types */ "../core/build/src/cds/cds_determine_types.js");
|
|
65420
|
+
const cds_lexer_1 = __webpack_require__(/*! ../cds/cds_lexer */ "../core/build/src/cds/cds_lexer.js");
|
|
65421
|
+
const version_1 = __webpack_require__(/*! ../version */ "../core/build/src/version.js");
|
|
65349
65422
|
const cds_parser_1 = __webpack_require__(/*! ../cds/cds_parser */ "../core/build/src/cds/cds_parser.js");
|
|
65350
65423
|
const expressions_1 = __webpack_require__(/*! ../cds/expressions */ "../core/build/src/cds/expressions/index.js");
|
|
65351
65424
|
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../core/build/src/objects/_abstract_object.js");
|
|
@@ -65437,8 +65510,8 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
65437
65510
|
associations: [],
|
|
65438
65511
|
tree: undefined,
|
|
65439
65512
|
};
|
|
65440
|
-
this.findSQLViewName();
|
|
65441
65513
|
this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());
|
|
65514
|
+
this.findSQLViewName(this.parsedData.tree);
|
|
65442
65515
|
if (this.parsedData.tree) {
|
|
65443
65516
|
for (const c of ((_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {
|
|
65444
65517
|
if (c.get() instanceof expressions_1.CDSAnnotation) {
|
|
@@ -65463,11 +65536,30 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
65463
65536
|
return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.tree;
|
|
65464
65537
|
}
|
|
65465
65538
|
//////////
|
|
65466
|
-
findSQLViewName() {
|
|
65539
|
+
findSQLViewName(tree) {
|
|
65467
65540
|
var _a;
|
|
65468
|
-
|
|
65469
|
-
if (
|
|
65470
|
-
|
|
65541
|
+
let annotations = tree === null || tree === void 0 ? void 0 : tree.findDirectExpressions(expressions_1.CDSAnnotation);
|
|
65542
|
+
if (annotations === undefined) {
|
|
65543
|
+
const file = this.findSourceFile();
|
|
65544
|
+
if (file === undefined) {
|
|
65545
|
+
return;
|
|
65546
|
+
}
|
|
65547
|
+
// Keep SQL view lookup available even when the view body cannot be parsed.
|
|
65548
|
+
const tokens = cds_lexer_1.CDSLexer.run(file).filter(t => !(t instanceof tokens_1.Comment));
|
|
65549
|
+
const leadingAnnotations = (0, combi_1.seq)((0, combi_1.starPrio)(expressions_1.CDSAnnotation), (0, combi_1.starPrio)((0, combi_1.regex)(/.*/)));
|
|
65550
|
+
annotations = (_a = combi_1.Combi.run(leadingAnnotations, tokens, version_1.defaultRelease)) === null || _a === void 0 ? void 0 : _a.filter((n) => n instanceof nodes_1.ExpressionNode && n.get() instanceof expressions_1.CDSAnnotation);
|
|
65551
|
+
}
|
|
65552
|
+
for (const annotation of annotations || []) {
|
|
65553
|
+
const tokens = annotation.getTokens().map(t => t.getStr());
|
|
65554
|
+
const colon = tokens.indexOf(":");
|
|
65555
|
+
if (tokens.slice(0, colon).join("") !== "@AbapCatalog.sqlViewName") {
|
|
65556
|
+
continue;
|
|
65557
|
+
}
|
|
65558
|
+
const match = tokens.slice(colon + 1).join(" ").match(/^'([\w/]+)'$/);
|
|
65559
|
+
if (match) {
|
|
65560
|
+
this.parsedData.sqlViewName = match[1].toUpperCase();
|
|
65561
|
+
return;
|
|
65562
|
+
}
|
|
65471
65563
|
}
|
|
65472
65564
|
}
|
|
65473
65565
|
findDescription() {
|
|
@@ -65493,12 +65585,16 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
65493
65585
|
let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
|
|
65494
65586
|
const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
|
|
65495
65587
|
if (list !== undefined) {
|
|
65496
|
-
const redirected =
|
|
65588
|
+
const redirected = e.concatTokens().toUpperCase().includes(" REDIRECTED TO ");
|
|
65497
65589
|
if (list.length > 1 && redirected === false) {
|
|
65498
65590
|
// "prefix.field" is looked up as "field" in "prefix", also when aliased via "as"
|
|
65499
65591
|
prefix = list[0].concatTokens();
|
|
65500
65592
|
nameInSource = list[list.length - 1].concatTokens();
|
|
65501
65593
|
}
|
|
65594
|
+
else if (list.length === 1 && redirected === false) {
|
|
65595
|
+
// unprefixed "field" is looked up in the sources, also when aliased via "as"
|
|
65596
|
+
nameInSource = list[0].concatTokens();
|
|
65597
|
+
}
|
|
65502
65598
|
if (found === undefined) {
|
|
65503
65599
|
found = redirected === true ? list[0] : list[list.length - 1];
|
|
65504
65600
|
}
|
|
@@ -72681,7 +72777,7 @@ class Registry {
|
|
|
72681
72777
|
}
|
|
72682
72778
|
static abaplintVersion() {
|
|
72683
72779
|
// magic, see build script "version.js"
|
|
72684
|
-
return "2.120.
|
|
72780
|
+
return "2.120.90";
|
|
72685
72781
|
}
|
|
72686
72782
|
getDDICReferences() {
|
|
72687
72783
|
return this.ddicReferences;
|
|
@@ -101943,7 +102039,7 @@ class PreferStringTemplate extends _abap_rule_1.ABAPRule {
|
|
|
101943
102039
|
continue;
|
|
101944
102040
|
}
|
|
101945
102041
|
const operands = this.flattenChain(source);
|
|
101946
|
-
if (!operands.some(op =>
|
|
102042
|
+
if (!operands.some(op => this.isLiteral(op))) {
|
|
101947
102043
|
continue;
|
|
101948
102044
|
}
|
|
101949
102045
|
const template = this.buildTemplate(operands);
|
|
@@ -101968,10 +102064,11 @@ class PreferStringTemplate extends _abap_rule_1.ABAPRule {
|
|
|
101968
102064
|
buildTemplate(operands) {
|
|
101969
102065
|
let inner = "";
|
|
101970
102066
|
for (const op of operands) {
|
|
101971
|
-
|
|
101972
|
-
|
|
101973
|
-
|
|
101974
|
-
|
|
102067
|
+
if (this.isLiteral(op)) {
|
|
102068
|
+
const raw = op.getFirstToken().getStr();
|
|
102069
|
+
const delimiter = raw[0];
|
|
102070
|
+
const value = raw.slice(1, -1).split(delimiter + delimiter).join(delimiter);
|
|
102071
|
+
inner += value.replace(/[\\|{}]/g, "\\$&");
|
|
101975
102072
|
}
|
|
101976
102073
|
else {
|
|
101977
102074
|
inner += `{ ${op.concatTokens()} }`;
|
|
@@ -101979,6 +102076,14 @@ class PreferStringTemplate extends _abap_rule_1.ABAPRule {
|
|
|
101979
102076
|
}
|
|
101980
102077
|
return `|${inner}|`;
|
|
101981
102078
|
}
|
|
102079
|
+
// plain character or string literal, ie. not text symbols or concatenated constants
|
|
102080
|
+
isLiteral(op) {
|
|
102081
|
+
if (op.getFirstToken() !== op.getLastToken()) {
|
|
102082
|
+
return false;
|
|
102083
|
+
}
|
|
102084
|
+
const firstChar = op.getFirstToken().getStr()[0];
|
|
102085
|
+
return firstChar === "'" || firstChar === "`";
|
|
102086
|
+
}
|
|
101982
102087
|
}
|
|
101983
102088
|
exports.PreferStringTemplate = PreferStringTemplate;
|
|
101984
102089
|
//# sourceMappingURL=prefer_string_template.js.map
|
|
@@ -112099,6 +112204,7 @@ class XMLConsistency {
|
|
|
112099
112204
|
extendedInformation: `Checks:
|
|
112100
112205
|
* XML is well-formed and parseable
|
|
112101
112206
|
* Naming for CLAS and INTF objects
|
|
112207
|
+
* CLAS and INTF objects do not contain fields that abapGit clears, eg. AUTHOR, CREATEDON and VERSION
|
|
112102
112208
|
* QUAN fields in TABL objects have reference table and field values
|
|
112103
112209
|
* Transparent TABL objects have delivery class and size category set
|
|
112104
112210
|
* TABL fields with a built-in type carry the INTTYPE abapGit serializes for it, for the confirmed pairs
|
|
@@ -112184,6 +112290,22 @@ class XMLConsistency {
|
|
|
112184
112290
|
else if (((_a = obj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getStructure()) !== undefined && obj.getClassDefinition() === undefined) {
|
|
112185
112291
|
issues.push(issue_1.Issue.atRow(file, 1, "Class matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
|
|
112186
112292
|
}
|
|
112293
|
+
issues.push(...this.checkClearedFields(obj, file, "VSEOCLASS", XMLConsistency.clearedClassFields));
|
|
112294
|
+
return issues;
|
|
112295
|
+
}
|
|
112296
|
+
checkClearedFields(obj, file, structure, fields) {
|
|
112297
|
+
var _a, _b;
|
|
112298
|
+
const issues = [];
|
|
112299
|
+
const block = (_b = (_a = obj.getXML()) === null || _a === void 0 ? void 0 : _a.match(new RegExp(`<${structure}>([\\s\\S]*?)</${structure}>`))) === null || _b === void 0 ? void 0 : _b[1];
|
|
112300
|
+
if (block === undefined) {
|
|
112301
|
+
return issues;
|
|
112302
|
+
}
|
|
112303
|
+
for (const field of fields) {
|
|
112304
|
+
if (block.match(new RegExp(`<${field}[\\s/>]`)) !== null) {
|
|
112305
|
+
const message = `Field ${field} in ${structure} is cleared by abapGit and should not be in the XML`;
|
|
112306
|
+
issues.push(issue_1.Issue.atRow(file, 1, message, this.getMetadata().key, this.conf.severity));
|
|
112307
|
+
}
|
|
112308
|
+
}
|
|
112187
112309
|
return issues;
|
|
112188
112310
|
}
|
|
112189
112311
|
runTextPool(obj, file) {
|
|
@@ -112217,6 +112339,7 @@ class XMLConsistency {
|
|
|
112217
112339
|
else if (obj.getDefinition() !== undefined && ((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.getName().toUpperCase()) !== name.toUpperCase()) {
|
|
112218
112340
|
issues.push(issue_1.Issue.atRow(file, 1, "Interface matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
|
|
112219
112341
|
}
|
|
112342
|
+
issues.push(...this.checkClearedFields(obj, file, "VSEOINTERF", XMLConsistency.clearedInterfaceFields));
|
|
112220
112343
|
return issues;
|
|
112221
112344
|
}
|
|
112222
112345
|
checkTextLength(file, fieldName, text, maxLength, lang) {
|
|
@@ -112397,6 +112520,14 @@ class XMLConsistency {
|
|
|
112397
112520
|
}
|
|
112398
112521
|
}
|
|
112399
112522
|
exports.XMLConsistency = XMLConsistency;
|
|
112523
|
+
// fields abapGit clears before serializing, see ZCL_ABAPGIT_OO_CLASS and ZCL_ABAPGIT_OO_INTERFACE;
|
|
112524
|
+
// abapGit omits initial fields, so any occurrence shows as a diff on every pull
|
|
112525
|
+
XMLConsistency.clearedInterfaceFields = [
|
|
112526
|
+
"UUID", "AUTHOR", "CREATEDON", "CHANGEDBY", "CHANGEDON", "CHGDANYBY", "CHGDANYON", "R3RELEASE", "VERSION",
|
|
112527
|
+
];
|
|
112528
|
+
XMLConsistency.clearedClassFields = [
|
|
112529
|
+
...XMLConsistency.clearedInterfaceFields, "CLSFINAL", "CLSABSTRCT", "EXPOSURE",
|
|
112530
|
+
];
|
|
112400
112531
|
// INTTYPE that abapGit serializes for a built-in DATATYPE, confirmed by exported tables;
|
|
112401
112532
|
// a different value activates, but shows as a diff on every pull
|
|
112402
112533
|
XMLConsistency.intTypes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.90",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.120.
|
|
42
|
+
"@abaplint/core": "^2.120.90",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|