Skip to content

Leave empty lines after Function Module declaration #106

Closed

Description

@MDagni

In SE37 editor, if I leave an empty line after function module declaration, SE37 and Abap debugger shows it with 1 empty line, and ADT shows with 4 empty lines at the start.

image

image

I have configured the "Standardize empty lines within methods" rule to leave 1 empty line at method start. When I run the cleaner on this function module, it leaves only 1 line as supposed. But when the function is activated, the backend removes all the empty lines and it looks like there are no empty lines in SAP GUI (SE37 or debugger). When I edit the function in ADT, I see 3 empty lines.

image

After cleaning, before activation:
image

After activation:
image

image

I believe Cleaner should leave 4 empty lines after function module declarations (3+configured value), as only then we can see the 1 line in GUI.

Activity

  1. MDagni commented on Sep 15, 2023

    @MDagni
    Author

    This also causes another issue; notice the line numbers change between "before activation" and "after activation" after the cleanup. The first line of code appears on 5th line, then it goes to 7th line when activated.

  2. fabianlupa commented on Sep 15, 2023

    @fabianlupa

    I guess the reasoning behind this is that both ADT and SE37 users can refer to the same line of code by its line number. Though this does look terrible in ADT :(

  3. self-assigned this
    on Sep 22, 2023
  4. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi Mehmet,

    I guess I can consider myself lucky to usually be working with OO code, so I didn't come across this … well … phenomenon myself yet!

    From what I observed, ADT always ensures 3 empty lines if the function module has parameters, and 1 empty line if it doesn't. So, like you suggested, ABAP cleaner should do the same, meaning (3+configured value) empty lines in case of parameters. This will be fixed in the next release!

    With that, if 4 empty lines are found, only 1 will be removed here:
    image
    image

    With your settings, none would be removed anymore:
    image
    image

    Also, some documentation was added:
    image

    And yes, this does look terrible… but it's probably the best solution while function modules are still around.

    Kind regards,
    Jörg-Michael

  5. MDagni commented on Sep 22, 2023

    @MDagni
    Author

    Thank you @jmgrassau , this is what I was expecting.

  6. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi Mehmet,

    thanks again for this issue – this is now fixed in version 1.5.4 which was just released!

    Kind regards,
    Jörg-Michael

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions