@abaplint/core 2.113.23 → 2.113.25
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/README.md +6 -6
- package/build/abaplint.d.ts +12 -1
- package/build/src/abap/2_statements/expressions/source.js +2 -1
- package/build/src/abap/2_statements/expressions/type_table.js +2 -2
- package/build/src/abap/flow/flow_graph.js +7 -7
- package/build/src/abap/types/basic/_abstract_type.js +4 -0
- package/build/src/cds/expressions/cds_source.js +1 -2
- package/build/src/ddic.js +39 -33
- package/build/src/lsp/_lookup.js +3 -0
- package/build/src/lsp/help.js +7 -7
- package/build/src/objects/data_definition.js +5 -5
- package/build/src/objects/data_element.js +11 -1
- package/build/src/objects/domain.js +9 -1
- package/build/src/objects/table.js +6 -1
- package/build/src/objects/table_type.js +6 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/7bit_ascii.js +4 -4
- package/build/src/rules/abapdoc.js +4 -4
- package/build/src/rules/add_test_attributes.js +20 -20
- package/build/src/rules/align_parameters.js +40 -40
- package/build/src/rules/align_type_expressions.js +28 -28
- package/build/src/rules/ambiguous_statement.js +7 -7
- package/build/src/rules/avoid_use.js +10 -10
- package/build/src/rules/begin_end_names.js +4 -4
- package/build/src/rules/begin_single_include.js +13 -13
- package/build/src/rules/call_transaction_authority_check.js +3 -3
- package/build/src/rules/cds_comment_style.js +4 -4
- package/build/src/rules/cds_legacy_view.js +4 -4
- package/build/src/rules/chain_mainly_declarations.js +4 -4
- package/build/src/rules/change_if_to_case.js +8 -8
- package/build/src/rules/check_abstract.js +2 -2
- package/build/src/rules/check_comments.js +4 -4
- package/build/src/rules/check_include.js +3 -3
- package/build/src/rules/check_subrc.js +8 -8
- package/build/src/rules/classic_exceptions_overlap.js +10 -10
- package/build/src/rules/commented_code.js +1 -1
- package/build/src/rules/constructor_visibility_public.js +4 -4
- package/build/src/rules/contains_tab.js +2 -2
- package/build/src/rules/cyclic_oo.js +4 -4
- package/build/src/rules/dangerous_statement.js +1 -1
- package/build/src/rules/definitions_top.js +6 -6
- package/build/src/rules/downport.js +87 -91
- package/build/src/rules/easy_to_find_messages.js +6 -6
- package/build/src/rules/empty_event.js +6 -6
- package/build/src/rules/empty_line_in_statement.js +2 -2
- package/build/src/rules/empty_structure.js +6 -6
- package/build/src/rules/exit_or_check.js +3 -3
- package/build/src/rules/expand_macros.js +5 -5
- package/build/src/rules/exporting.js +1 -1
- package/build/src/rules/forbidden_identifier.js +1 -1
- package/build/src/rules/forbidden_void_type.js +2 -2
- package/build/src/rules/fully_type_itabs.js +2 -2
- package/build/src/rules/functional_writing.js +17 -17
- package/build/src/rules/global_class.js +8 -8
- package/build/src/rules/identical_conditions.js +12 -12
- package/build/src/rules/identical_contents.js +14 -14
- package/build/src/rules/identical_descriptions.js +6 -6
- package/build/src/rules/if_in_if.js +35 -35
- package/build/src/rules/implement_methods.js +3 -3
- package/build/src/rules/implicit_start_of_selection.js +5 -5
- package/build/src/rules/in_statement_indentation.js +11 -11
- package/build/src/rules/indentation.js +16 -16
- package/build/src/rules/intf_referencing_clas.js +3 -3
- package/build/src/rules/invalid_table_index.js +2 -2
- package/build/src/rules/line_break_style.js +2 -2
- package/build/src/rules/line_length.js +1 -1
- package/build/src/rules/line_only_punc.js +1 -1
- package/build/src/rules/local_variable_names.js +6 -6
- package/build/src/rules/macro_naming.js +2 -2
- package/build/src/rules/main_file_contents.js +4 -4
- package/build/src/rules/many_parentheses.js +10 -10
- package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
- package/build/src/rules/max_one_statement.js +5 -5
- package/build/src/rules/method_length.js +2 -2
- package/build/src/rules/method_overwrites_builtin.js +12 -12
- package/build/src/rules/mix_returning.js +6 -6
- package/build/src/rules/nesting.js +1 -1
- package/build/src/rules/no_chained_assignment.js +1 -1
- package/build/src/rules/no_external_form_calls.js +2 -2
- package/build/src/rules/no_inline_in_optional_branches.js +11 -11
- package/build/src/rules/no_prefixes.js +6 -6
- package/build/src/rules/no_public_attributes.js +1 -1
- package/build/src/rules/no_yoda_conditions.js +4 -4
- package/build/src/rules/nrob_consistency.js +2 -2
- package/build/src/rules/obsolete_statement.js +51 -51
- package/build/src/rules/omit_parameter_name.js +3 -3
- package/build/src/rules/omit_receiving.js +13 -13
- package/build/src/rules/parser_702_chaining.js +2 -2
- package/build/src/rules/parser_error.js +2 -2
- package/build/src/rules/parser_missing_space.js +18 -7
- package/build/src/rules/prefer_inline.js +16 -16
- package/build/src/rules/prefer_is_not.js +9 -9
- package/build/src/rules/prefer_raise_exception_new.js +5 -5
- package/build/src/rules/prefer_returning_to_exporting.js +4 -4
- package/build/src/rules/prefer_xsdbool.js +2 -2
- package/build/src/rules/preferred_compare_operator.js +2 -2
- package/build/src/rules/reduce_procedural_code.js +17 -17
- package/build/src/rules/remove_descriptions.js +4 -4
- package/build/src/rules/rfc_error_handling.js +7 -7
- package/build/src/rules/select_add_order_by.js +5 -5
- package/build/src/rules/select_performance.js +5 -5
- package/build/src/rules/select_single_full_key.js +2 -2
- package/build/src/rules/sicf_consistency.js +2 -2
- package/build/src/rules/slow_parameter_passing.js +16 -16
- package/build/src/rules/space_before_dot.js +2 -2
- package/build/src/rules/sql_value_conversion.js +6 -6
- package/build/src/rules/start_at_tab.js +1 -1
- package/build/src/rules/strict_sql.js +6 -6
- package/build/src/rules/sy_modification.js +3 -3
- package/build/src/rules/tabl_enhancement_category.js +2 -2
- package/build/src/rules/tables_declared_locally.js +2 -2
- package/build/src/rules/type_form_parameters.js +2 -2
- package/build/src/rules/unnecessary_pragma.js +29 -29
- package/build/src/rules/unnecessary_return.js +11 -11
- package/build/src/rules/unused_macros.js +6 -6
- package/build/src/rules/unused_methods.js +12 -12
- package/build/src/rules/unused_variables.js +12 -12
- package/build/src/rules/use_bool_expression.js +8 -8
- package/build/src/rules/use_class_based_exceptions.js +8 -8
- package/build/src/rules/use_line_exists.js +6 -6
- package/build/src/rules/use_new.js +4 -4
- package/build/src/rules/when_others_last.js +6 -6
- package/package.json +70 -70
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# @abaplint/core
|
|
2
|
-
|
|
3
|
-
[abaplint](https://abaplint.org) core library
|
|
4
|
-
|
|
5
|
-
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
-
|
|
1
|
+
# @abaplint/core
|
|
2
|
+
|
|
3
|
+
[abaplint](https://abaplint.org) core library
|
|
4
|
+
|
|
5
|
+
Exposes functionality like the parser and rules, which can be used in other projects.
|
|
6
|
+
|
|
7
7
|
For more information see https://github.com/abaplint/abaplint
|
package/build/abaplint.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export declare abstract class AbstractType {
|
|
|
115
115
|
/** fully qualified symbolic name of the type */
|
|
116
116
|
getQualifiedName(): string | undefined;
|
|
117
117
|
getRTTIName(): string | undefined;
|
|
118
|
+
getDescription(): string | undefined;
|
|
118
119
|
getConversionExit(): string | undefined;
|
|
119
120
|
getDDICName(): string | undefined;
|
|
120
121
|
abstract toText(level: number): string;
|
|
@@ -130,6 +131,7 @@ declare type AbstractTypeData = {
|
|
|
130
131
|
derivedFromConstant?: boolean;
|
|
131
132
|
ddicName?: string;
|
|
132
133
|
RTTIName?: string;
|
|
134
|
+
description?: string;
|
|
133
135
|
};
|
|
134
136
|
|
|
135
137
|
declare class ActivationVariant extends AbstractObject {
|
|
@@ -1632,7 +1634,16 @@ declare class DDIC {
|
|
|
1632
1634
|
lookupTable(name: string | undefined): AbstractType;
|
|
1633
1635
|
private lookupView;
|
|
1634
1636
|
lookupTableType(name: string | undefined): ILookupResult;
|
|
1635
|
-
textToType(
|
|
1637
|
+
textToType(input: {
|
|
1638
|
+
text: string | undefined;
|
|
1639
|
+
length: string | undefined;
|
|
1640
|
+
decimals: string | undefined;
|
|
1641
|
+
infoText: string;
|
|
1642
|
+
qualifiedName?: string;
|
|
1643
|
+
conversionExit?: string;
|
|
1644
|
+
ddicName?: string;
|
|
1645
|
+
description?: string;
|
|
1646
|
+
}): AbstractType;
|
|
1636
1647
|
}
|
|
1637
1648
|
|
|
1638
1649
|
declare enum DDLKind {
|
|
@@ -18,6 +18,7 @@ class Source extends combi_1.Expression {
|
|
|
18
18
|
const method = (0, combi_1.seq)(_1.MethodCallChain, (0, combi_1.optPrio)((0, combi_1.altPrio)(attr, comp)), deref);
|
|
19
19
|
const rparen = (0, combi_1.tok)(tokens_1.WParenRightW);
|
|
20
20
|
const rparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
21
|
+
const lparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW));
|
|
21
22
|
// paren used for eg. "( 2 + 1 ) * 4"
|
|
22
23
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), Source, rparen);
|
|
23
24
|
const after = (0, combi_1.seq)((0, combi_1.altPrio)("&", "&&", _1.ArithOperator), Source);
|
|
@@ -25,7 +26,7 @@ class Source extends combi_1.Expression {
|
|
|
25
26
|
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
|
|
26
27
|
const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain, deref), paren), (0, combi_1.optPrio)(after));
|
|
27
28
|
const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
|
|
28
|
-
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer,
|
|
29
|
+
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, lparenNoSpace, _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
29
30
|
const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
30
31
|
const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
31
32
|
const cond = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("COND", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CondBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
@@ -13,8 +13,8 @@ class TypeTable extends combi_1.Expression {
|
|
|
13
13
|
const generic = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE");
|
|
14
14
|
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), _1.TypeName);
|
|
15
15
|
const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
|
|
16
|
-
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
17
|
-
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
16
|
+
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial), (0, combi_1.optPrio)("VALUE IS INITIAL"));
|
|
17
|
+
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial), (0, combi_1.optPrio)("VALUE IS INITIAL"));
|
|
18
18
|
// a maximum of 15 secondary table keys can be defined
|
|
19
19
|
// "WITH" is not allowed as a field name in keys
|
|
20
20
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
@@ -94,13 +94,13 @@ class FlowGraph {
|
|
|
94
94
|
this.label = label;
|
|
95
95
|
}
|
|
96
96
|
toDigraph() {
|
|
97
|
-
return `digraph G {
|
|
98
|
-
labelloc="t";
|
|
99
|
-
label="${this.label}";
|
|
100
|
-
graph [fontname = "helvetica"];
|
|
101
|
-
node [fontname = "helvetica", shape="box"];
|
|
102
|
-
edge [fontname = "helvetica"];
|
|
103
|
-
${this.toTextEdges()}
|
|
97
|
+
return `digraph G {
|
|
98
|
+
labelloc="t";
|
|
99
|
+
label="${this.label}";
|
|
100
|
+
graph [fontname = "helvetica"];
|
|
101
|
+
node [fontname = "helvetica", shape="box"];
|
|
102
|
+
edge [fontname = "helvetica"];
|
|
103
|
+
${this.toTextEdges()}
|
|
104
104
|
}`;
|
|
105
105
|
}
|
|
106
106
|
listSources(node) {
|
|
@@ -17,6 +17,10 @@ class AbstractType {
|
|
|
17
17
|
var _a;
|
|
18
18
|
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.RTTIName;
|
|
19
19
|
}
|
|
20
|
+
getDescription() {
|
|
21
|
+
var _a;
|
|
22
|
+
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.description;
|
|
23
|
+
}
|
|
20
24
|
getConversionExit() {
|
|
21
25
|
var _a;
|
|
22
26
|
return (_a = this.data) === null || _a === void 0 ? void 0 : _a.conversionExit;
|
|
@@ -5,8 +5,7 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSSource extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
|
|
9
|
-
return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
|
|
8
|
+
return (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSAs));
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
exports.CDSSource = CDSSource;
|
package/build/src/ddic.js
CHANGED
|
@@ -304,9 +304,15 @@ class DDIC {
|
|
|
304
304
|
return { type: new Types.VoidType(name) };
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
textToType(
|
|
307
|
+
textToType(input) {
|
|
308
308
|
// todo: support short strings, and length of different integers, NUMC vs CHAR, min/max length
|
|
309
|
-
|
|
309
|
+
const extra = {
|
|
310
|
+
qualifiedName: input.qualifiedName,
|
|
311
|
+
conversionExit: input.conversionExit,
|
|
312
|
+
ddicName: input.ddicName,
|
|
313
|
+
description: input.description,
|
|
314
|
+
};
|
|
315
|
+
switch (input.text) {
|
|
310
316
|
case "DEC": // 1 <= len <= 31
|
|
311
317
|
case "D16F": // 1 <= len <= 31
|
|
312
318
|
case "D16D":
|
|
@@ -315,45 +321,45 @@ class DDIC {
|
|
|
315
321
|
case "DF34_DEC": // 1 <= len <= 31
|
|
316
322
|
case "CURR": // 1 <= len <= 31
|
|
317
323
|
case "QUAN": // 1 <= len <= 31
|
|
318
|
-
if (length === undefined) {
|
|
319
|
-
return new Types.UnknownType(text + " unknown length, " + infoText, infoText);
|
|
324
|
+
if (input.length === undefined) {
|
|
325
|
+
return new Types.UnknownType(input.text + " unknown length, " + input.infoText, input.infoText);
|
|
320
326
|
}
|
|
321
|
-
else if (decimals === undefined) {
|
|
322
|
-
return new Types.PackedType(parseInt(length, 10), 0,
|
|
327
|
+
else if (input.decimals === undefined) {
|
|
328
|
+
return new Types.PackedType(parseInt(input.length, 10), 0, extra);
|
|
323
329
|
}
|
|
324
|
-
return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10),
|
|
330
|
+
return new Types.PackedType(parseInt(input.length, 10), parseInt(input.decimals, 10), extra);
|
|
325
331
|
case "ACCP":
|
|
326
|
-
return new Types.CharacterType(6,
|
|
332
|
+
return new Types.CharacterType(6, extra); // YYYYMM
|
|
327
333
|
case "LANG":
|
|
328
|
-
return new Types.CharacterType(1,
|
|
334
|
+
return new Types.CharacterType(1, extra);
|
|
329
335
|
case "CLNT":
|
|
330
|
-
return new Types.CharacterType(3,
|
|
336
|
+
return new Types.CharacterType(3, extra);
|
|
331
337
|
case "CUKY":
|
|
332
|
-
return new Types.CharacterType(5,
|
|
338
|
+
return new Types.CharacterType(5, extra);
|
|
333
339
|
case "UNIT": // 2 <= len <= 3
|
|
334
|
-
return new Types.CharacterType(3,
|
|
340
|
+
return new Types.CharacterType(3, extra);
|
|
335
341
|
case "UTCLONG":
|
|
336
|
-
return new Types.CharacterType(27,
|
|
342
|
+
return new Types.CharacterType(27, extra);
|
|
337
343
|
case "NUMC": // 1 <= len <= 255
|
|
338
|
-
if (length === undefined) {
|
|
339
|
-
return new Types.UnknownType(text + " unknown length", infoText);
|
|
344
|
+
if (input.length === undefined) {
|
|
345
|
+
return new Types.UnknownType(input.text + " unknown length", input.infoText);
|
|
340
346
|
}
|
|
341
|
-
return new Types.NumericType(parseInt(length, 10), qualifiedName);
|
|
347
|
+
return new Types.NumericType(parseInt(input.length, 10), input.qualifiedName);
|
|
342
348
|
case "CHAR": // 1 <= len <= 30000 (1333 for table fields)
|
|
343
349
|
case "LCHR": // 256 <= len <= 32000
|
|
344
|
-
if (length === undefined) {
|
|
345
|
-
return new Types.UnknownType(text + " unknown length", infoText);
|
|
350
|
+
if (input.length === undefined) {
|
|
351
|
+
return new Types.UnknownType(input.text + " unknown length", input.infoText);
|
|
346
352
|
}
|
|
347
|
-
return new Types.CharacterType(parseInt(length, 10),
|
|
353
|
+
return new Types.CharacterType(parseInt(input.length, 10), extra);
|
|
348
354
|
case "RAW": // 1 <= len <= 32000
|
|
349
355
|
case "LRAW": // 256 <= len <= 32000
|
|
350
|
-
if (length === undefined) {
|
|
351
|
-
return new Types.UnknownType(text + " unknown length", infoText);
|
|
356
|
+
if (input.length === undefined) {
|
|
357
|
+
return new Types.UnknownType(input.text + " unknown length", input.infoText);
|
|
352
358
|
}
|
|
353
|
-
return new Types.HexType(parseInt(length, 10), qualifiedName);
|
|
359
|
+
return new Types.HexType(parseInt(input.length, 10), input.qualifiedName);
|
|
354
360
|
case "TIMN": // Native HANA
|
|
355
361
|
case "TIMS":
|
|
356
|
-
return new Types.TimeType({ qualifiedName: qualifiedName }); //HHMMSS
|
|
362
|
+
return new Types.TimeType({ qualifiedName: input.qualifiedName }); //HHMMSS
|
|
357
363
|
case "DECFLOAT16": // len = 16
|
|
358
364
|
case "DECFLOAT34": // len = 34
|
|
359
365
|
case "D16R": // len = 16
|
|
@@ -361,37 +367,37 @@ class DDIC {
|
|
|
361
367
|
case "DF16_RAW": // len = 16
|
|
362
368
|
case "DF34_RAW": // len = 34
|
|
363
369
|
case "FLTP": // len = 16
|
|
364
|
-
if (length === undefined) {
|
|
365
|
-
return new Types.UnknownType(text + " unknown length", infoText);
|
|
370
|
+
if (input.length === undefined) {
|
|
371
|
+
return new Types.UnknownType(input.text + " unknown length", input.infoText);
|
|
366
372
|
}
|
|
367
|
-
return new Types.FloatingPointType(parseInt(length, 10), qualifiedName);
|
|
373
|
+
return new Types.FloatingPointType(parseInt(input.length, 10), input.qualifiedName);
|
|
368
374
|
case "DATN": // Native HANA
|
|
369
375
|
case "DATS":
|
|
370
|
-
return new Types.DateType({ qualifiedName: qualifiedName }); //YYYYMMDD
|
|
376
|
+
return new Types.DateType({ qualifiedName: input.qualifiedName }); //YYYYMMDD
|
|
371
377
|
case "INT1":
|
|
372
378
|
case "INT2":
|
|
373
379
|
case "INT4":
|
|
374
|
-
return Types.IntegerType.get({ qualifiedName: qualifiedName });
|
|
380
|
+
return Types.IntegerType.get({ qualifiedName: input.qualifiedName });
|
|
375
381
|
case "INT8":
|
|
376
|
-
return new Types.Integer8Type({ qualifiedName: qualifiedName });
|
|
382
|
+
return new Types.Integer8Type({ qualifiedName: input.qualifiedName });
|
|
377
383
|
case "SSTR": // 1 <= len <= 1333
|
|
378
384
|
case "SSTRING": // 1 <= len <= 1333
|
|
379
385
|
case "STRG": // 256 <= len
|
|
380
386
|
case "STRING": // 256 <= len
|
|
381
|
-
return Types.StringType.get({ qualifiedName: qualifiedName });
|
|
387
|
+
return Types.StringType.get({ qualifiedName: input.qualifiedName });
|
|
382
388
|
case "RSTR": // 256 <= len
|
|
383
389
|
case "RAWSTRING": // 256 <= len
|
|
384
390
|
case "GEOM_EWKB":
|
|
385
|
-
return new Types.XStringType({ qualifiedName: qualifiedName });
|
|
391
|
+
return new Types.XStringType({ qualifiedName: input.qualifiedName });
|
|
386
392
|
case "D16S":
|
|
387
393
|
case "D34S":
|
|
388
394
|
case "DF16_SCL":
|
|
389
395
|
case "DF34_SCL":
|
|
390
396
|
case "PREC":
|
|
391
397
|
case "VARC":
|
|
392
|
-
return new Types.UnknownType(text + " is an obsolete data type", infoText);
|
|
398
|
+
return new Types.UnknownType(input.text + " is an obsolete data type", input.infoText);
|
|
393
399
|
default:
|
|
394
|
-
return new Types.UnknownType(text + " unknown", infoText);
|
|
400
|
+
return new Types.UnknownType(input.text + " unknown", input.infoText);
|
|
395
401
|
}
|
|
396
402
|
}
|
|
397
403
|
}
|
package/build/src/lsp/_lookup.js
CHANGED
|
@@ -185,6 +185,9 @@ class LSPLookup {
|
|
|
185
185
|
if (variable.getType().getDDICName() !== undefined) {
|
|
186
186
|
value += "\n\nDDIC Name: ```" + variable.getType().getDDICName() + "```";
|
|
187
187
|
}
|
|
188
|
+
if (variable.getType().getDescription() !== undefined) {
|
|
189
|
+
value += "\n\nDescription: " + variable.getType().getDescription();
|
|
190
|
+
}
|
|
188
191
|
return value;
|
|
189
192
|
}
|
|
190
193
|
static referenceHover(ref, scope, reg) {
|
package/build/src/lsp/help.js
CHANGED
|
@@ -19,13 +19,13 @@ class Help {
|
|
|
19
19
|
/////////////////////////////////////////////////
|
|
20
20
|
static dumpABAP(file, reg, textDocument, position) {
|
|
21
21
|
let content = "";
|
|
22
|
-
content = `
|
|
23
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
-
<hr>
|
|
22
|
+
content = `
|
|
23
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
24
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
25
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
26
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
27
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
28
|
+
<hr>
|
|
29
29
|
` +
|
|
30
30
|
"<tt>" + textDocument.uri + " (" +
|
|
31
31
|
(position.line + 1) + ", " +
|
|
@@ -155,15 +155,15 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
findSourcesAndRelations(tree) {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f;
|
|
158
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
159
159
|
for (const e of tree.findAllExpressions(expressions_1.CDSSource)) {
|
|
160
|
-
const name = e.
|
|
161
|
-
const as = (
|
|
160
|
+
const name = ((_a = e.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase().replace(/ /g, "")) || "ERROR";
|
|
161
|
+
const as = (_c = (_b = e.findDirectExpression(expressions_1.CDSAs)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(expressions_1.CDSName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr();
|
|
162
162
|
this.parsedData.sources.push({ name, as });
|
|
163
163
|
}
|
|
164
164
|
for (const e of tree.findAllExpressions(expressions_1.CDSRelation)) {
|
|
165
165
|
const name = e.getFirstToken().getStr();
|
|
166
|
-
const as = (
|
|
166
|
+
const as = (_e = (_d = e.findDirectExpression(expressions_1.CDSAs)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(expressions_1.CDSName)) === null || _e === void 0 ? void 0 : _e.getFirstToken().getStr();
|
|
167
167
|
this.parsedData.relations.push({ name, as });
|
|
168
168
|
}
|
|
169
169
|
for (const e of tree.findAllExpressions(expressions_1.CDSAssociation)) {
|
|
@@ -172,7 +172,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
174
174
|
const name = j.getFirstToken().getStr();
|
|
175
|
-
const as = (
|
|
175
|
+
const as = (_g = (_f = j.findDirectExpression(expressions_1.CDSAs)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(expressions_1.CDSName)) === null || _g === void 0 ? void 0 : _g.getFirstToken().getStr();
|
|
176
176
|
this.parsedData.associations.push({
|
|
177
177
|
name: name || "ERROR",
|
|
178
178
|
as: as,
|
|
@@ -38,6 +38,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
|
|
|
38
38
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.texts;
|
|
39
39
|
}
|
|
40
40
|
parseType(reg) {
|
|
41
|
+
var _a;
|
|
41
42
|
const references = [];
|
|
42
43
|
let lookup = undefined;
|
|
43
44
|
if (this.parsedXML === undefined) {
|
|
@@ -66,7 +67,16 @@ class DataElement extends _abstract_object_1.AbstractObject {
|
|
|
66
67
|
lookup = { type: new Types.UnknownType("DATATYPE unexpectely empty in " + this.getName()) };
|
|
67
68
|
}
|
|
68
69
|
else {
|
|
69
|
-
lookup = { type: ddic.textToType(
|
|
70
|
+
lookup = { type: ddic.textToType({
|
|
71
|
+
text: this.parsedXML.datatype,
|
|
72
|
+
length: this.parsedXML.leng,
|
|
73
|
+
decimals: this.parsedXML.decimals,
|
|
74
|
+
infoText: this.getName(),
|
|
75
|
+
qualifiedName: this.getName(),
|
|
76
|
+
conversionExit: undefined,
|
|
77
|
+
ddicName: this.getName(),
|
|
78
|
+
description: (_a = this.parsedXML.texts) === null || _a === void 0 ? void 0 : _a.heading,
|
|
79
|
+
}) };
|
|
70
80
|
}
|
|
71
81
|
}
|
|
72
82
|
}
|
|
@@ -37,7 +37,15 @@ class Domain extends _abstract_object_1.AbstractObject {
|
|
|
37
37
|
return new Types.UnknownType("Domain " + this.getName() + " parser error", this.getName());
|
|
38
38
|
}
|
|
39
39
|
const ddic = new ddic_1.DDIC(reg);
|
|
40
|
-
return ddic.textToType(
|
|
40
|
+
return ddic.textToType({
|
|
41
|
+
text: this.parsedXML.datatype,
|
|
42
|
+
length: this.parsedXML.length,
|
|
43
|
+
decimals: this.parsedXML.decimals,
|
|
44
|
+
infoText: this.getName(),
|
|
45
|
+
qualifiedName: dataElement,
|
|
46
|
+
conversionExit: this.parsedXML.conversionExit,
|
|
47
|
+
ddicName: dataElement,
|
|
48
|
+
});
|
|
41
49
|
}
|
|
42
50
|
parse() {
|
|
43
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -221,7 +221,12 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
221
221
|
const length = field.LENG ? field.LENG : field.INTLEN;
|
|
222
222
|
components.push({
|
|
223
223
|
name: field.FIELDNAME,
|
|
224
|
-
type: ddic.textToType(
|
|
224
|
+
type: ddic.textToType({
|
|
225
|
+
text: datatype,
|
|
226
|
+
length: length,
|
|
227
|
+
decimals: field.DECIMALS,
|
|
228
|
+
infoText: this.getName() + "-" + field.FIELDNAME,
|
|
229
|
+
})
|
|
225
230
|
});
|
|
226
231
|
}
|
|
227
232
|
else {
|
|
@@ -140,7 +140,12 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
140
140
|
type = new Types.UnknownType("Table Type, empty DATATYPE" + this.getName(), this.getName());
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
|
-
const row = ddic.textToType(
|
|
143
|
+
const row = ddic.textToType({
|
|
144
|
+
text: this.parsedXML.datatype,
|
|
145
|
+
length: this.parsedXML.leng,
|
|
146
|
+
decimals: this.parsedXML.decimals,
|
|
147
|
+
infoText: this.getName(),
|
|
148
|
+
});
|
|
144
149
|
type = new Types.TableType(row, tableOptions, this.getName());
|
|
145
150
|
}
|
|
146
151
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -17,10 +17,10 @@ class SevenBitAscii {
|
|
|
17
17
|
key: "7bit_ascii",
|
|
18
18
|
title: "Check for 7bit ascii",
|
|
19
19
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
20
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
-
|
|
22
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
23
|
-
|
|
20
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
21
|
+
|
|
22
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
23
|
+
|
|
24
24
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
25
25
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
26
26
|
badExample: `WRITE '뽑'.`,
|
|
@@ -28,10 +28,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
28
28
|
key: "abapdoc",
|
|
29
29
|
title: "Check abapdoc",
|
|
30
30
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
31
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
32
|
-
|
|
33
|
-
Plus class and interface definitions.
|
|
34
|
-
|
|
31
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
32
|
+
|
|
33
|
+
Plus class and interface definitions.
|
|
34
|
+
|
|
35
35
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
36
36
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
37
37
|
};
|
|
@@ -21,27 +21,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
21
21
|
title: "Add test attributes for tests classes with test methods",
|
|
22
22
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
23
23
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
25
|
-
PUBLIC SECTION.
|
|
26
|
-
PROTECTED SECTION.
|
|
27
|
-
PRIVATE SECTION.
|
|
28
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
29
|
-
ENDCLASS.
|
|
30
|
-
|
|
31
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
32
|
-
METHOD test.
|
|
33
|
-
ENDMETHOD.
|
|
24
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
25
|
+
PUBLIC SECTION.
|
|
26
|
+
PROTECTED SECTION.
|
|
27
|
+
PRIVATE SECTION.
|
|
28
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
29
|
+
ENDCLASS.
|
|
30
|
+
|
|
31
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
32
|
+
METHOD test.
|
|
33
|
+
ENDMETHOD.
|
|
34
34
|
ENDCLASS.`,
|
|
35
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
36
|
-
PUBLIC SECTION.
|
|
37
|
-
PROTECTED SECTION.
|
|
38
|
-
PRIVATE SECTION.
|
|
39
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
40
|
-
ENDCLASS.
|
|
41
|
-
|
|
42
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
43
|
-
METHOD test.
|
|
44
|
-
ENDMETHOD.
|
|
35
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
36
|
+
PUBLIC SECTION.
|
|
37
|
+
PROTECTED SECTION.
|
|
38
|
+
PRIVATE SECTION.
|
|
39
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
40
|
+
ENDCLASS.
|
|
41
|
+
|
|
42
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
43
|
+
METHOD test.
|
|
44
|
+
ENDMETHOD.
|
|
45
45
|
ENDCLASS.`,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -22,49 +22,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
22
22
|
key: "align_parameters",
|
|
23
23
|
title: "Align Parameters",
|
|
24
24
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
25
|
-
extendedInformation: `Checks:
|
|
26
|
-
* function module calls
|
|
27
|
-
* method calls
|
|
28
|
-
* VALUE constructors
|
|
29
|
-
* NEW constructors
|
|
30
|
-
* RAISE EXCEPTION statements
|
|
31
|
-
* CREATE OBJECT statements
|
|
32
|
-
* RAISE EVENT statements
|
|
33
|
-
|
|
34
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
35
|
-
|
|
36
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
37
|
-
|
|
38
|
-
If parameters are on the same row, no issues are reported, see
|
|
25
|
+
extendedInformation: `Checks:
|
|
26
|
+
* function module calls
|
|
27
|
+
* method calls
|
|
28
|
+
* VALUE constructors
|
|
29
|
+
* NEW constructors
|
|
30
|
+
* RAISE EXCEPTION statements
|
|
31
|
+
* CREATE OBJECT statements
|
|
32
|
+
* RAISE EVENT statements
|
|
33
|
+
|
|
34
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
35
|
+
|
|
36
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
37
|
+
|
|
38
|
+
If parameters are on the same row, no issues are reported, see
|
|
39
39
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
40
40
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
41
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
42
|
-
EXPORTING
|
|
43
|
-
foo = 2
|
|
44
|
-
parameter = 3.
|
|
45
|
-
|
|
46
|
-
foobar( moo = 1
|
|
47
|
-
param = 1 ).
|
|
48
|
-
|
|
49
|
-
foo = VALUE #(
|
|
50
|
-
foo = bar
|
|
41
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
42
|
+
EXPORTING
|
|
43
|
+
foo = 2
|
|
44
|
+
parameter = 3.
|
|
45
|
+
|
|
46
|
+
foobar( moo = 1
|
|
47
|
+
param = 1 ).
|
|
48
|
+
|
|
49
|
+
foo = VALUE #(
|
|
50
|
+
foo = bar
|
|
51
51
|
moo = 2 ).`,
|
|
52
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53
|
-
EXPORTING
|
|
54
|
-
foo = 2
|
|
55
|
-
parameter = 3.
|
|
56
|
-
|
|
57
|
-
foobar( moo = 1
|
|
58
|
-
param = 1 ).
|
|
59
|
-
|
|
60
|
-
foo = VALUE #(
|
|
61
|
-
foo = bar
|
|
62
|
-
moo = 2 ).
|
|
63
|
-
|
|
64
|
-
DATA(sdf) = VALUE type(
|
|
65
|
-
common_val = 2
|
|
66
|
-
another_common = 5
|
|
67
|
-
( row_value = 4
|
|
52
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53
|
+
EXPORTING
|
|
54
|
+
foo = 2
|
|
55
|
+
parameter = 3.
|
|
56
|
+
|
|
57
|
+
foobar( moo = 1
|
|
58
|
+
param = 1 ).
|
|
59
|
+
|
|
60
|
+
foo = VALUE #(
|
|
61
|
+
foo = bar
|
|
62
|
+
moo = 2 ).
|
|
63
|
+
|
|
64
|
+
DATA(sdf) = VALUE type(
|
|
65
|
+
common_val = 2
|
|
66
|
+
another_common = 5
|
|
67
|
+
( row_value = 4
|
|
68
68
|
value_foo = 5 ) ).`,
|
|
69
69
|
};
|
|
70
70
|
}
|