fidley / ABAPQuickFix

ABAP Quick Fix
https://abapblog.com
MIT License
42 stars 9 forks source link

new feature: sort data declarations; bugfix split data statements #59

Closed lukas-mb closed 11 months ago

lukas-mb commented 11 months ago
fidley commented 11 months ago

Perfect. I will do review later on and I'll approve when I'll test it successful (and deploy to update site for others)!

Thanks!

fidley commented 11 months ago

I see the ordering is working nice, but I have one remark -> it does not work if you don't have the declaration under one DATA statement Here it works image

Here not image

Are you able to make it work also with selected code if all concurrent statements are of the same type (ex. DATA)?

lukas-mb commented 11 months ago

Ahh... totally forgotten this case. Will implement this asap :)

fidley commented 11 months ago

Take your time 😁

lukas-mb commented 11 months ago

Any thoughts on how to sort declarations like this?

image

I'm not sure what the best logic would be... maybe activate the sorting just for single statements, so it is considering the single declarations until there are multiple declarations within one DATA. Here for example it would sort just lv_maktx, lt_lips and lv_objky, then sort the next 'block' ls_lips and go_salv_table and so on.

Would you also consider inline declarations?

fidley commented 11 months ago

Normally inline declaration are done in different place than top of method, program, so I would not focus on them. For the rest I see two possibilities:

    • Sort everything, does not matter if they are inside one DATA statement or not
    • sort only those which are linked under one DATA: statement.

    I guess preferable would be the 1st version, but maybe it is good to give developer the right to decide? New parameter or two quick fixes, one for each option?

lukas-mb commented 11 months ago

I agree with inline declarations - will store them below the other declarations if a user would use them in this area... you never know.

And I also like the idea of an additional quick fix👍🏼

fidley commented 10 months ago

Hi @lukas-mb any news here, or should I publish as it is now?

lukas-mb commented 10 months ago

Hi @fidley, still working on this.. Difficult to say when it's finished (or when I get some time for it). I would estimate within the next two weeks. So let's wait :)

fidley commented 10 months ago

Perfect ;)