Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickfix: Pseudo Comment #509

Merged
3 commits merged into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Legend
+ : added
- : removed

2021-XX-XX v.1.17.0
------------------
+ Quickfix: Pseudo Comment (#509)

2021-11-01 v.1.16.0
------------------
* Prefer New: Dynamic Call with Parameters (#502)
Expand Down
29 changes: 27 additions & 2 deletions src/foundation/y_check_base.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
parameter_02 TYPE csequence OPTIONAL
parameter_03 TYPE csequence OPTIONAL
parameter_04 TYPE csequence OPTIONAL
additional_information TYPE xstring OPTIONAL
check_configuration TYPE y_if_clean_code_manager=>check_configuration. "#EC OPTL_PARAM

METHODS set_check_message IMPORTING message TYPE itex132.
Expand Down Expand Up @@ -136,6 +135,9 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
METHODS get_tadir_keys IMPORTING statement TYPE sstmnt
RETURNING VALUE(result) TYPE tadir.

METHODS add_pseudo_comment_quickfix IMPORTING check_configuration TYPE y_if_clean_code_manager=>check_configuration
statement_index TYPE int4.

ENDCLASS.


Expand Down Expand Up @@ -447,6 +449,8 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
AND check_configurations[ 1 ]-object_creation_date IS INITIAL.
CLEAR check_configurations.
ENDIF.

quickfix_factory = cl_ci_quickfix_creation=>create_quickfix_alternatives( ).
ENDMETHOD.


Expand Down Expand Up @@ -475,6 +479,9 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.

handle_ignore_pseudo_comments( check_configuration ).

add_pseudo_comment_quickfix( check_configuration = check_configuration
statement_index = statement_index ).

IF is_running_unit_test( ) = abap_true.
handle_unit_test_statistics( statement_index = statement_index
check_configuration = check_configuration ).
Expand All @@ -492,7 +499,7 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
p_param_2 = parameter_02
p_param_3 = parameter_03
p_param_4 = parameter_04
p_detail = additional_information ).
p_detail = quickfix_factory->export_to_xstring( ) ).
ENDIF.
ENDMETHOD.

Expand Down Expand Up @@ -686,4 +693,22 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
ENDMETHOD.


METHOD add_pseudo_comment_quickfix.
CHECK settings-pseudo_comment IS NOT INITIAL.
CHECK check_configuration-ignore_pseudo_comments = abap_false.

DATA(context) = cl_ci_quickfix_abap_context=>create_from_scan_stmt( p_ci_scan = ref_scan
p_stmt_idx = statement_index ).

DATA(quickfix) = quickfix_factory->create_quickfix( ).

quickfix->add_docu_from_msgclass( p_msg_class = 'Y_CODE_PAL_MESSAGES'
p_msg_number = '001'
p_msg_parameter1 = settings-pseudo_comment ).

quickfix->if_ci_quickfix_abap_actions~insert_after( p_new_code = settings-pseudo_comment
p_context = context ).
ENDMETHOD.


ENDCLASS.
20 changes: 20 additions & 0 deletions src/foundation/y_code_pal_messages.msag.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_MSAG" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<T100A>
<ARBGB>Y_CODE_PAL_MESSAGES</ARBGB>
<MASTERLANG>E</MASTERLANG>
<STEXT>Messages</STEXT>
</T100A>
<T100>
<T100>
<SPRSL>E</SPRSL>
<ARBGB>Y_CODE_PAL_MESSAGES</ARBGB>
<MSGNR>001</MSGNR>
<TEXT>Add Pseudo Comment (&amp;1)</TEXT>
</T100>
</T100>
</asx:values>
</asx:abap>
</abapGit>