Skip to content

QuickFix #459

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

Closed
lucasborin opened this issue Sep 14, 2021 · 2 comments · Fixed by #509
Closed

QuickFix #459

lucasborin opened this issue Sep 14, 2021 · 2 comments · Fixed by #509
Assignees
Labels
feature New feature or refactoring

Comments

@lucasborin
Copy link
Member

lucasborin commented Sep 14, 2021

Y_CHECK_BASE:
image

It looks like there is a possibility to implement quick fixes. Further analysis is required.

@lucasborin lucasborin added the feature New feature or refactoring label Sep 14, 2021
@lucasborin lucasborin self-assigned this Sep 22, 2021
@lucasborin
Copy link
Member Author

It's ADT-specific.

@lucasborin
Copy link
Member Author

A very short quick fix (draft) to implement the Pseudo Comments using the Eclipse:

Ctrl+F1:
image

Mass quick fix:
image

Code created by the quick fix:
image

Quick fix code:

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

    quickfix_factory = cl_ci_quickfix_creation=>create_quickfix_alternatives( ).

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

    quickfix->add_docu_from_msgclass( p_msg_class      = 'ZBORINLU'
                                      p_msg_number     = '100' ).

    quickfix->enable_automatic_execution( ).

    DATA(fix) = CAST if_ci_quickfix_abap_actions( quickfix ).

    fix->insert_after( p_new_code = settings-pseudo_comment
                       p_context  = context ).

You have to assign the quick fix to the p_detail:

      inform( p_sub_obj_type = object_type
              p_sub_obj_name = get_include( p_level = statement_level )
              p_position = statement_index
              p_line = get_line_abs( statement_from )
              p_column = get_column_abs( statement_from )
              p_errcnt = error_counter
              p_kind = check_configuration-prio
              p_test = myname
              p_code = get_code( check_configuration-prio )
              p_param_1 = parameter_01
              p_param_2 = parameter_02
              p_param_3 = parameter_03
              p_param_4 = parameter_04
              p_detail = quickfix_factory->export_to_xstring( ) ).

@lucasborin lucasborin linked a pull request Nov 1, 2021 that will close this issue
@ghost ghost closed this as completed Feb 8, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or refactoring
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant