Skip to content

Rearrange local declarations: sorting not kept as defined in rule settings #414

@ziegleran

Description

@ziegleran

Hello,

I have set up the rule 'Rearrange local declarations' in the following way:
Image

Now, I have a method implementation, which defines some import parameters typed as table types.

methods my_method_name
  importing
    it_import_test type standard table of tadir.

Within the method, I have the following declaration part sorted in an opinionated order:

data ls_import_test like line of it_import_test.
data lv_some_other_value type i.

I often use ABAPCleaner for the whole class. Then it gets reformatted to:

data lv_some_other_value type i.
data ls_import_test like line of it_import_test.

It also resorts, if the complete method is selected (including the method- and endmethod-statements). Selecting the declaration block only doesn't reformat.

Based on issue #230, I understand, that variable-definitions using like have to be sorted below type, because the definition has to exist before. But in my example, the referenced definition comes from the method definition and not from the method implementation itself.

I can rearrange manually and activate the source code. But what confused me, that I use the settings as shown above and the definitions are rearrange anyhow.

Would it technically be possible to recognize also this constellation? Could it be fixed with one of the future releases?

Thanks and kind regards,
Andreas Ziegler

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions