Skip to content

Alignment of parameters with NEW statement not working #153

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
MagneeR opened this issue Oct 17, 2023 · 10 comments
Closed

Alignment of parameters with NEW statement not working #153

MagneeR opened this issue Oct 17, 2023 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@MagneeR
Copy link

MagneeR commented Oct 17, 2023

Hi!
I'm using the ABAP Cleaner tool and I realize that its not working as I expected with the NEW operator.

Original code and ABAP Cleaner return:
image

Expected result:
image

Can you add a new rule for this?
Thank you!

@ConjuringCoffee
Copy link
Contributor

ConjuringCoffee commented Oct 17, 2023

You can already use rule "Align parameters and components" to achieve this. 😉

Here are the settings I am personally using to achieve that result:

image

@fabianlupa
Copy link

As the styleguide explicitly demands to break parameters I would have assumed the necessary options are both activated in the default ("going beyond the guide") and essential ("explicitly demanded by the guide") profile. I also checked normal method calls which aren't cleaned with line breaks either.

@MagneeR
Copy link
Author

MagneeR commented Oct 18, 2023

I was trying to aplly @ConjuringCoffee settings but i can't select any rule. Any idea of what to do to fix it?
Maybe reinstalling ABAP Cleaner?
image
Thank you for your help!

@jmgrassau
Copy link
Member

Hi MagneeR,

that's really odd, I've never seen this. Seems like the rules list is minimized rather than grabbing all (vertical) space that it gets. What happens if you change the size of this window? Which OS and which Java / SapMachine version are you using?

Kind regards,
Jörg-Michael

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

P.S.: Apart from that, this is the same as in #154: Things are kept on one line because of this option:

image

which should not happen in this case, because it is not a table row.

Kind regards,
Jörg-Michael

@MagneeR
Copy link
Author

MagneeR commented Oct 18, 2023

Hi Jörg-Michael,

I made the window smaller and all the rules appear again. Now I know what to do in case it happens again.
Thank you for all!

@MagneeR MagneeR closed this as completed Oct 18, 2023
@jmgrassau jmgrassau self-assigned this Oct 18, 2023
@jmgrassau
Copy link
Member

Hi MagneeR,

thanks for reporting this issue with the NEW operator, as well as #154. This will be fixed in the next release, meaning that regardless of the setting for "Table rows: Keep multiple components on single line", line breaks will be introduced to non-table-rows cases, as they should:

image

Kind regards,
Jörg-Michael

@MagneeR
Copy link
Author

MagneeR commented Oct 18, 2023

Hi Jörg-Michael,
That's perfect! 😄

You are doing a great job.
Thank you very much!

@ConjuringCoffee
Copy link
Contributor

I didn't even know I wanted that, great 😁

@jmgrassau
Copy link
Member

Hi MagneeR,

thanks again for pointing this out – this should now be fixed in version 1.8.0, 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

4 participants