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

"Standardize empty lines within methods" deletes lines when applied but let them live in profile settings #195

Closed
VladGhitulescu opened this issue Nov 10, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@VladGhitulescu
Copy link

Hey,

I have a problem with the rule "Standardize empty lines within methods" deleting lines in code when the ABAP Cleaner runs - the same code behaves different when pasted in the configuration window.

Here is the code in the configuration window:

CleanShot 2023-11-10 at 13 24 42

I'd like to preserve the 2 empty lines (row-nr. 4 and 5) between DATA and the FREE-statement so I set the "Max. empty lines within methods"-parameter to 2.
It looks like the lines would be preserve BUT

CleanShot 2023-11-10 at 13 25 42@2x

as soon as I run the ABAP Cleaner one of the lines get deleted.

Could you please help me with this?

Thanks!

Regards,
Vlad

@jmgrassau jmgrassau added the bug Something isn't working label Nov 11, 2023
@jmgrassau
Copy link
Member

Hi Vlad,

that's a good point – this is done by the rule "Rearrange local declarations" (even if it has nothing to rearrange in this case). It would indeed be better if "Rearrange local declarations" observed the setting from "Standardize empty lines within methods"!

Another issue is that if "Rearrange local declarations" changes something (even the number of line breaks), it should be displayed in the "Rule Used in Current Selection" list in the main window, which was not the case when I tried the scenario.

Kind regards,
Jörg-Michael

@VladGhitulescu
Copy link
Author

Hi JM,

which parameter of "Rearrange local declarations" does this?

Regards,
Vlad

@jmgrassau jmgrassau self-assigned this Nov 12, 2023
@jmgrassau
Copy link
Member

Hi Vlad,

there is no parameter for this in "Rearrange local declarations" – but I now changed the rule to simply keep multiple empty lines if they are found in such cases, so this will be fixed with the next release.

Kind regards,
Jörg-Michael

@VladGhitulescu
Copy link
Author

Thanks JM!

@jmgrassau
Copy link
Member

Hi Vlad,

this should now be fixed with version 1.11.1, 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

2 participants