@abaplint/cli 2.120.40 → 2.120.41
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 +26 -2
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -70174,7 +70174,7 @@ class Registry {
|
|
|
70174
70174
|
}
|
|
70175
70175
|
static abaplintVersion() {
|
|
70176
70176
|
// magic, see build script "version.js"
|
|
70177
|
-
return "2.120.
|
|
70177
|
+
return "2.120.41";
|
|
70178
70178
|
}
|
|
70179
70179
|
getDDICReferences() {
|
|
70180
70180
|
return this.ddicReferences;
|
|
@@ -72865,7 +72865,7 @@ const KNOWN_CURR_DATA_ELEMENTS = ["BWERT", "DZWERT"];
|
|
|
72865
72865
|
const RESERVED_ELEMENT_NAMES = ["BEGIN", "NUMBER", "POSITION"];
|
|
72866
72866
|
const MAX_LABEL_LENGTH = 40;
|
|
72867
72867
|
// Annotations which are not supported in CDS view entities
|
|
72868
|
-
const VIEW_ENTITY_FORBIDDEN_ANNOTATIONS = ["Semantics.unitOfMeasure"];
|
|
72868
|
+
const VIEW_ENTITY_FORBIDDEN_ANNOTATIONS = ["Semantics.unitOfMeasure", "Semantics.currencyCode"];
|
|
72869
72869
|
class CDSCheckSyntax {
|
|
72870
72870
|
constructor() {
|
|
72871
72871
|
this.conf = new CDSCheckSyntaxConf();
|
|
@@ -72909,6 +72909,7 @@ Missing objects are only reported when their names match the configured errorNam
|
|
|
72909
72909
|
this.checkFieldAnnotations(tree, ddic, issues, file);
|
|
72910
72910
|
this.checkLabels(tree, issues, file);
|
|
72911
72911
|
this.checkViewEntityAnnotations(tree, issues, file);
|
|
72912
|
+
this.checkSearchable(tree, issues, file);
|
|
72912
72913
|
this.checkReservedNames(tree, issues, file);
|
|
72913
72914
|
this.checkFields(tree, sources, object, issues, file);
|
|
72914
72915
|
return issues;
|
|
@@ -73130,6 +73131,29 @@ Missing objects are only reported when their names match the configured errorNam
|
|
|
73130
73131
|
}
|
|
73131
73132
|
}
|
|
73132
73133
|
}
|
|
73134
|
+
checkSearchable(tree, issues, file) {
|
|
73135
|
+
let searchable;
|
|
73136
|
+
for (const annotation of tree.findAllExpressionsRecursive(expressions_1.CDSAnnotation)) {
|
|
73137
|
+
const normalized = annotation.concatTokens().replace(/\s/g, "").toUpperCase().replace(/^@</, "@");
|
|
73138
|
+
if (this.hasSearchAnnotation(normalized, "defaultSearchElement")) {
|
|
73139
|
+
return;
|
|
73140
|
+
}
|
|
73141
|
+
else if (searchable === undefined && this.hasSearchAnnotation(normalized, "searchable")) {
|
|
73142
|
+
searchable = annotation;
|
|
73143
|
+
}
|
|
73144
|
+
}
|
|
73145
|
+
if (searchable !== undefined) {
|
|
73146
|
+
const message = "@Search.defaultSearchElement: true required on at least one element " +
|
|
73147
|
+
"when @Search.searchable: true";
|
|
73148
|
+
issues.push(issue_1.Issue.atToken(file, searchable.getFirstToken(), message, this.getMetadata().key, this.conf.severity));
|
|
73149
|
+
}
|
|
73150
|
+
}
|
|
73151
|
+
hasSearchAnnotation(normalized, name) {
|
|
73152
|
+
if (normalized.startsWith("@SEARCH") === false) {
|
|
73153
|
+
return false;
|
|
73154
|
+
}
|
|
73155
|
+
return new RegExp("[.{,]" + name.toUpperCase() + ":TRUE").test(normalized);
|
|
73156
|
+
}
|
|
73133
73157
|
checkReservedNames(tree, issues, file) {
|
|
73134
73158
|
var _a, _b;
|
|
73135
73159
|
for (const element of tree.findAllExpressionsRecursive(expressions_1.CDSElement)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.41",
|
|
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.41",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|