Skip to content

"Align parameters and components" moves comment incorrectly #380

Closed

Description

@ConjuringCoffee

Hi Jörg-Michael, I have found a case where the rule "Align parameters and components" moves a comment incorrectly.

Example (expected):

TYPES: BEGIN OF gy_structure,
         id    TYPE i,
         match TYPE abap_bool,
       END OF gy_structure.
TYPES gy_table TYPE TABLE OF gy_structure WITH EMPTY KEY.

DATA gt_table TYPE gy_table.

gt_table = VALUE #( ( " Comment for the first line 
                      id    = 1
                      match = abap_true )
                    ( " Comment for the second line
                      id    = 2
                      match = abap_false ) ).

Actual result:

gt_table = VALUE #( " Comment for the first line 
                    ( id    = 1
                      match = abap_true )
                    ( " Comment for the second line
                      id    = 2
                      match = abap_false ) ).

The comment for the first line is moved outside of the brackets. This only happens for the first line of a table.

As always, this is the profile I am using: https://github.com/endresshauser-infoserve/abap-cleaner-profile

Activity

  1. self-assigned this
    on Dec 5, 2024
  2. jmgrassau commented on Dec 5, 2024

    @jmgrassau
    Member

    Hi ConjuringCoffee,

    thanks for this example – actually, there was a dedicated branch to do exactly that, but I don't remember what kind of a case I had in mind where this would be beneficial (and none of the tests showed such a case, either). So, I removed this branch, and the comment will now stay inside the inner parentheses.

    Kind regards,
    Jörg-Michael

  3. jmgrassau commented on Dec 16, 2024

    @jmgrassau
    Member

    Hi ConjuringCoffee,

    thanks for this bug report! This should now be fixed with version 1.21.0, which was just released.

    Kind regards,
    Jörg-Michael

  4. ConjuringCoffee commented on Dec 27, 2024

    @ConjuringCoffee
    ContributorAuthor

    Thank you :)

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