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

Leave empty lines after Function Module declaration #106

Closed
MDagni opened this issue Sep 15, 2023 · 5 comments
Closed

Leave empty lines after Function Module declaration #106

MDagni opened this issue Sep 15, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@MDagni
Copy link

MDagni commented Sep 15, 2023

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.

@MDagni
Copy link
Author

MDagni commented Sep 15, 2023

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.

@fabianlupa
Copy link

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 :(

@jmgrassau jmgrassau added the bug Something isn't working label Sep 22, 2023
@jmgrassau jmgrassau self-assigned this Sep 22, 2023
@jmgrassau
Copy link
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

@MDagni
Copy link
Author

MDagni commented Sep 22, 2023

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

@jmgrassau
Copy link
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
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants