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

Feature request: Align FORM definitions #84

Closed
ConjuringCoffee opened this issue Aug 2, 2023 · 4 comments
Closed

Feature request: Align FORM definitions #84

ConjuringCoffee opened this issue Aug 2, 2023 · 4 comments
Assignees

Comments

@ConjuringCoffee
Copy link
Contributor

Hi Jörg-Michael, I'd like to request the automatic alignment of FORM definitions.

@jmgrassau
Copy link
Member

Hi ConjuringCoffee,

yes, that would be a nice thing to have!

Kind regards,
Jörg-Michael

@kaisicker
Copy link

I would really like to have that as well!

@jmgrassau
Copy link
Member

Hi ConjuringCoffee and kaisicker,

version 1.10.0, which was just released, now offers the new cleanup rule "Align FORM declarations"! I hope the configuration …

image

… allows you to get the format you'd like to have, and of course I tried to find good defaults. As you can see in the examples,

FORM any_subroutine USING iv_any_value TYPE string.

  " any subroutine implementation
ENDFORM.


FORM other_subroutine USING iv_any_value TYPE i iv_other_value TYPE string CHANGING cv_third_value TYPE i.
  " other subroutine implementation
ENDFORM.


FORM third_subr_with_a_long_name TABLES it_any_table STRUCTURE ty_s_any_struc
  it_other_table TYPE STANDARD TABLE it_third_table it_fourth_table TYPE ty_tt_any
  CHANGING ct_table TYPE ty_tt_table cs_struc TYPE LINE OF ty_tt_any cs_other_struc LIKE cs_any
    cs_third_struc LIKE LINE OF ct_table.
  " third subroutine implementation
ENDFORM.


FORM fourth_subroutine
  USING
    VALUE(iv_any) TYPE string
    iv_other TYPE REF TO object
  RAISING
    cx_any_exception RESUMABLE(cx_other_exception) cx_third_exception.
  " fourth subroutine implementation
ENDFORM.

will be changed into:

FORM any_subroutine USING iv_any_value TYPE string.
  " any subroutine implementation
ENDFORM.


FORM other_subroutine USING    iv_any_value   TYPE i
                               iv_other_value TYPE string
                      CHANGING cv_third_value TYPE i.

  " other subroutine implementation
ENDFORM.


FORM third_subr_with_a_long_name
  TABLES   it_any_table    STRUCTURE ty_s_any_struc
           it_other_table  TYPE STANDARD TABLE
           it_third_table
           it_fourth_table TYPE ty_tt_any
  CHANGING ct_table        TYPE ty_tt_table
           cs_struc        TYPE LINE OF ty_tt_any
           cs_other_struc  LIKE cs_any
           cs_third_struc  LIKE LINE OF ct_table.

  " third subroutine implementation
ENDFORM.


FORM fourth_subroutine
  USING   VALUE(iv_any) TYPE string
          iv_other      TYPE REF TO object
  RAISING cx_any_exception
          RESUMABLE(cx_other_exception)
          cx_third_exception.

  " fourth subroutine implementation
ENDFORM.

Kind regards,
Jörg-Michael

@kaisicker
Copy link

Brilliant! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants