@abaplint/core 2.119.2 → 2.119.4
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 +5 -0
- package/build/src/abap/5_syntax/_scope_type.js +2 -0
- package/build/src/abap/5_syntax/statements/get_pf_status.js +26 -0
- package/build/src/abap/5_syntax/syntax.js +28 -0
- package/build/src/abap/types/class_definition.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/keep_single_parameter_on_one_line.js +4 -2
- package/build/src/rules/main_file_contents.js +2 -0
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -5942,6 +5942,7 @@ declare abstract class ScopeData {
|
|
|
5942
5942
|
export declare enum ScopeType {
|
|
5943
5943
|
BuiltIn = "_builtin",
|
|
5944
5944
|
Dummy = "_dummy",
|
|
5945
|
+
SelectionEvent = "selection_event",
|
|
5945
5946
|
Global = "_global",
|
|
5946
5947
|
Program = "_program",
|
|
5947
5948
|
TypePool = "_type_pool",
|
|
@@ -7071,6 +7072,10 @@ export declare class SyntaxLogic {
|
|
|
7071
7072
|
*/
|
|
7072
7073
|
private updateScopeStructure;
|
|
7073
7074
|
private updateScopeStatement;
|
|
7075
|
+
private updateSelectionEventScope;
|
|
7076
|
+
private opensSelectionEventScope;
|
|
7077
|
+
private isSelectionEventBoundary;
|
|
7078
|
+
private isSelectionEventBoundaryStructure;
|
|
7074
7079
|
}
|
|
7075
7080
|
|
|
7076
7081
|
declare class SystemCall implements IStatement {
|
|
@@ -5,6 +5,8 @@ var ScopeType;
|
|
|
5
5
|
(function (ScopeType) {
|
|
6
6
|
ScopeType["BuiltIn"] = "_builtin";
|
|
7
7
|
ScopeType["Dummy"] = "_dummy";
|
|
8
|
+
// definitions inside this one are local
|
|
9
|
+
ScopeType["SelectionEvent"] = "selection_event";
|
|
8
10
|
ScopeType["Global"] = "_global";
|
|
9
11
|
ScopeType["Program"] = "_program";
|
|
10
12
|
ScopeType["TypePool"] = "_type_pool";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPFStatus = void 0;
|
|
4
|
+
const Expressions = require("../../2_statements/expressions");
|
|
5
|
+
const source_1 = require("../expressions/source");
|
|
6
|
+
const target_1 = require("../expressions/target");
|
|
7
|
+
const basic_1 = require("../../types/basic");
|
|
8
|
+
const inline_data_1 = require("../expressions/inline_data");
|
|
9
|
+
class GetPFStatus {
|
|
10
|
+
runSyntax(node, input) {
|
|
11
|
+
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
12
|
+
source_1.Source.runSyntax(s, input);
|
|
13
|
+
}
|
|
14
|
+
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
15
|
+
const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
|
|
16
|
+
if (inline) {
|
|
17
|
+
inline_data_1.InlineData.runSyntax(inline, input, basic_1.VoidType.get("GET_PF_STATUS"));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
target_1.Target.runSyntax(t, input);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GetPFStatus = GetPFStatus;
|
|
26
|
+
//# sourceMappingURL=get_pf_status.js.map
|
|
@@ -84,6 +84,7 @@ const read_report_1 = require("./statements/read_report");
|
|
|
84
84
|
const authority_check_1 = require("./statements/authority_check");
|
|
85
85
|
const insert_report_1 = require("./statements/insert_report");
|
|
86
86
|
const get_reference_1 = require("./statements/get_reference");
|
|
87
|
+
const get_pf_status_1 = require("./statements/get_pf_status");
|
|
87
88
|
const insert_database_1 = require("./statements/insert_database");
|
|
88
89
|
const delete_database_1 = require("./statements/delete_database");
|
|
89
90
|
const import_dynpro_1 = require("./statements/import_dynpro");
|
|
@@ -152,6 +153,7 @@ const commit_entities_1 = require("./statements/commit_entities");
|
|
|
152
153
|
const _syntax_input_1 = require("./_syntax_input");
|
|
153
154
|
const assert_error_1 = require("./assert_error");
|
|
154
155
|
const field_group_1 = require("./statements/field_group");
|
|
156
|
+
const stuff_1 = require("../../stuff");
|
|
155
157
|
// -----------------------------------
|
|
156
158
|
const map = {};
|
|
157
159
|
function addToMap(handler) {
|
|
@@ -237,6 +239,7 @@ if (Object.keys(map).length === 0) {
|
|
|
237
239
|
addToMap(new if_1.If());
|
|
238
240
|
addToMap(new log_point_1.LogPoint());
|
|
239
241
|
addToMap(new while_1.While());
|
|
242
|
+
addToMap(new get_pf_status_1.GetPFStatus());
|
|
240
243
|
addToMap(new with_1.With());
|
|
241
244
|
addToMap(new with_loop_1.WithLoop());
|
|
242
245
|
addToMap(new call_transformation_1.CallTransformation());
|
|
@@ -405,6 +408,9 @@ class SyntaxLogic {
|
|
|
405
408
|
updateScopeStructure(node) {
|
|
406
409
|
const filename = this.currentFile.getFilename();
|
|
407
410
|
const stru = node.get();
|
|
411
|
+
if (this.scope.getType() === _scope_type_1.ScopeType.SelectionEvent && this.isSelectionEventBoundaryStructure(stru)) {
|
|
412
|
+
this.scope.pop(node.getFirstToken().getStart());
|
|
413
|
+
}
|
|
408
414
|
const input = {
|
|
409
415
|
scope: this.scope,
|
|
410
416
|
filename,
|
|
@@ -444,6 +450,7 @@ class SyntaxLogic {
|
|
|
444
450
|
updateScopeStatement(node) {
|
|
445
451
|
const filename = this.currentFile.getFilename();
|
|
446
452
|
const s = node.get();
|
|
453
|
+
this.updateSelectionEventScope(node);
|
|
447
454
|
const input = {
|
|
448
455
|
scope: this.scope,
|
|
449
456
|
filename,
|
|
@@ -489,6 +496,27 @@ class SyntaxLogic {
|
|
|
489
496
|
}
|
|
490
497
|
}
|
|
491
498
|
}
|
|
499
|
+
updateSelectionEventScope(node) {
|
|
500
|
+
const statement = node.get();
|
|
501
|
+
if (this.scope.getType() === _scope_type_1.ScopeType.SelectionEvent && this.isSelectionEventBoundary(statement)) {
|
|
502
|
+
this.scope.pop(node.getFirstToken().getStart());
|
|
503
|
+
}
|
|
504
|
+
if (this.opensSelectionEventScope(statement)) {
|
|
505
|
+
this.scope.push(_scope_type_1.ScopeType.SelectionEvent, statement.constructor.name, node.getFirstToken().getStart(), this.currentFile.getFilename());
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
opensSelectionEventScope(statement) {
|
|
509
|
+
return statement instanceof Statements.AtSelectionScreen;
|
|
510
|
+
}
|
|
511
|
+
isSelectionEventBoundary(statement) {
|
|
512
|
+
return stuff_1.SELECTION_EVENTS.some(event => statement instanceof event)
|
|
513
|
+
|| statement instanceof Statements.Form
|
|
514
|
+
|| statement instanceof Statements.FunctionModule;
|
|
515
|
+
}
|
|
516
|
+
isSelectionEventBoundaryStructure(structure) {
|
|
517
|
+
return structure instanceof Structures.ClassDefinition
|
|
518
|
+
|| structure instanceof Structures.Interface;
|
|
519
|
+
}
|
|
492
520
|
}
|
|
493
521
|
exports.SyntaxLogic = SyntaxLogic;
|
|
494
522
|
//# sourceMappingURL=syntax.js.map
|
|
@@ -173,7 +173,7 @@ class ClassDefinition extends _identifier_1.Identifier {
|
|
|
173
173
|
input.scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename);
|
|
174
174
|
}
|
|
175
175
|
else {
|
|
176
|
-
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, name.toUpperCase() + " does not exist"));
|
|
176
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, "Friend class " + name.toUpperCase() + " does not exist"));
|
|
177
177
|
}
|
|
178
178
|
result.push(name);
|
|
179
179
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -6,6 +6,7 @@ const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
|
6
6
|
const _abap_rule_1 = require("./_abap_rule");
|
|
7
7
|
const Expressions = require("../abap/2_statements/expressions");
|
|
8
8
|
const _irule_1 = require("./_irule");
|
|
9
|
+
const edit_helper_1 = require("../edit_helper");
|
|
9
10
|
class KeepSingleParameterCallsOnOneLineConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
@@ -25,7 +26,7 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
|
|
|
25
26
|
title: "Keep single parameters on one line",
|
|
26
27
|
shortDescription: `Keep single parameter calls on one line`,
|
|
27
28
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-single-parameter-calls-on-one-line`,
|
|
28
|
-
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
29
|
+
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
29
30
|
badExample: `call_method(\n 2 ).`,
|
|
30
31
|
goodExample: `call_method( 2 ).`,
|
|
31
32
|
};
|
|
@@ -101,7 +102,8 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
const message = "Keep single parameter on one line";
|
|
104
|
-
|
|
105
|
+
const fix = edit_helper_1.EditHelper.replaceRange(file, c.getFirstToken().getStart(), c.getLastToken().getEnd(), c.concatTokens());
|
|
106
|
+
return [issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix)];
|
|
105
107
|
}
|
|
106
108
|
return [];
|
|
107
109
|
}
|
|
@@ -5,6 +5,7 @@ const issue_1 = require("../issue");
|
|
|
5
5
|
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
6
6
|
const Objects = require("../objects");
|
|
7
7
|
const _abap_object_1 = require("../objects/_abap_object");
|
|
8
|
+
const _irule_1 = require("./_irule");
|
|
8
9
|
const Statements = require("../abap/2_statements/statements");
|
|
9
10
|
const Expressions = require("../abap/2_statements/expressions");
|
|
10
11
|
const position_1 = require("../position");
|
|
@@ -22,6 +23,7 @@ class MainFileContents {
|
|
|
22
23
|
key: "main_file_contents",
|
|
23
24
|
title: "Main file contents",
|
|
24
25
|
shortDescription: `Checks related to report declarations.`,
|
|
26
|
+
tags: [_irule_1.RuleTag.Syntax],
|
|
25
27
|
extendedInformation: `Does not run if the target version is Cloud
|
|
26
28
|
|
|
27
29
|
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|