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

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

Closed
ConjuringCoffee opened this issue May 25, 2023 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@ConjuringCoffee
Copy link
Contributor

ConjuringCoffee commented May 25, 2023

    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?

@jmgrassau jmgrassau added the enhancement New feature or request label May 25, 2023
@jmgrassau
Copy link
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

@ConjuringCoffee ConjuringCoffee changed the title Align parameters and components: WHERE condition of FOR not aligned? Align logical expressions: WHERE condition of FOR not aligned? May 25, 2023
@jmgrassau jmgrassau self-assigned this Jun 8, 2023
@jmgrassau
Copy link
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

@jmgrassau
Copy link
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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants