Skip to content

Align logical expressions: WHERE condition of FOR not aligned? #29

Closed

Description

@ConjuringCoffee
    DATA lt_vbak TYPE TABLE OF vbak.
    DATA lt_result LIKE lt_vbak.

    lt_result = VALUE #( FOR ls_vbak IN lt_vbak WHERE
                         ( vbeln = '1'
AND auart = 'A' )
                         ( ls_vbak ) ).

Above is an example in which the line AND auart = 'A' ) is not automatically aligned with the rest. It is only aligned if the previous line ( vbeln = '1' would also be aligned simultaneously. Is this a bug or is the behavior intended?

Activity

  1. jmgrassau commented on May 25, 2023

    @jmgrassau
    Member

    Hi ConjuringCoffee,

    actually this would be a case for the "Align logical expressions" rule which indeed does not yet consider WHERE clauses in constructor expressions!

    Kind regards,
    Jörg-Michael

  2. changed the title [-]Align parameters and components: WHERE condition of FOR not aligned?[/-] [+]Align logical expressions: WHERE condition of FOR not aligned?[/+] on May 25, 2023
  3. self-assigned this
    on Jun 8, 2023
  4. jmgrassau commented on Jun 9, 2023

    @jmgrassau
    Member

    Hi ConjuringCoffee,

    there were actually even three different issues to this, but "Align logical expressions" now behaves as expected:

    image

    However, IMHO, "WHERE" is not in a good place here: Since it starts the WHERE clause, it should be next to the logical expression, not somewhere at the end of the line above it. Therefore, the rule "Move AND/OR etc. from line end to next line start" was enhanced with a new option:

    image

    which results in:

    image

    image

    If you put these effects together, you get:

    image

    which I think makes this expression even more readable :-)

    Kind regards,
    Jörg-Michael

  5. jmgrassau commented on Jun 12, 2023

    @jmgrassau
    Member

    Hi ConjuringCoffee,

    hope release 1.4.0 does the trick :-)

    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

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions