Skip to content

Alignment of parameters with NEW statement not working #153

Closed

Description

@MagneeR

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!

Activity

  1. ConjuringCoffee commented on Oct 17, 2023

    @ConjuringCoffee
    Contributor

    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

  2. fabianlupa commented on Oct 18, 2023

    @fabianlupa

    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.

  3. MagneeR commented on Oct 18, 2023

    @MagneeR
    Author

    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!

  4. jmgrassau commented on Oct 18, 2023

    @jmgrassau
    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

  5. jmgrassau commented on Oct 18, 2023

    @jmgrassau
    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

  6. MagneeR commented on Oct 18, 2023

    @MagneeR
    Author

    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!

  7. self-assigned this
    on Oct 18, 2023
  8. jmgrassau commented on Oct 18, 2023

    @jmgrassau
    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

  9. MagneeR commented on Oct 18, 2023

    @MagneeR
    Author

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

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

  10. ConjuringCoffee commented on Oct 18, 2023

    @ConjuringCoffee
    Contributor

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

  11. jmgrassau commented on Oct 23, 2023

    @jmgrassau
    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

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