Giter Site home page Giter Site logo

Comments (4)

jmgrassau avatar jmgrassau commented on September 27, 2024 1

Hi ConjuringCoffee,

yes, that second example definitely doesn't look good (although in a way it's not wrong). On the other hand, if you had a variable name here such as ```[ lv_index ]``, it could have any length between 1 and 30 chars, and at some point you'd want a line break. So, let's see what can be done about it – maybe it should simply be prevented to introduce line breaks when the content is very short.

What I'd consider a bug is the last example, because if ABAP cleaner moves table_nested[ behind the opening (, there is no reason to keep the line break. I'll have to check why that happens!

Kind regards,
Jörg-Michael

from abap-cleaner.

jmgrassau avatar jmgrassau commented on September 27, 2024 1

Hi ConjuringCoffee,

thanks again for opening this issue – this was indeed a bug, because table expressions that are chained with ][ were not processed properly. With your example and settings, I now get:

    DATA(this_is_a_very_very_long__name) = NEW lcl_example( )->this_is_a_very_very_long_name(
                                                   table_normal[ 1 ] ).

    DATA(this_is_a_very_very_long_name2) = NEW lcl_example( )->this_is_a_very_very_long_name(
                                                   table_nested[ 1 ][ 1 ] ).

Condensing also works now (without keeping unnecessary line breaks), so if you enter …

    any_method(
    lt_any_table[ 
    1 ][ 
    2 ][ 
    3 ] ).

    any_method(
    par1 = lt_any_table[ 
    1 ]
    param2 = lt_any_table[ 
    1 ][ 
    2 ]
    parameter3 = lt_any_table[ 
    1 ][ 
    2 ][ 
    3 ] ).

you will get:

    any_method( lt_any_table[ 1 ][ 2 ][ 3 ] ).

    any_method( par1       = lt_any_table[ 1 ]
                param2     = lt_any_table[ 1 ][ 2 ]
                parameter3 = lt_any_table[ 1 ][ 2 ][ 3 ] ).

And an example where a line break cannot be avoided …

    DATA(lv_some_value_with_a_long_name) = any_method(
    lt_any_table[
    lv_index ][
    lv_second_index ][
    lv_third_index_with_long_name ] ).

… will look like this:

    DATA(lv_some_value_with_a_long_name) = any_method( lt_any_table[ lv_index ][ lv_second_index ][
                                                           lv_third_index_with_long_name ] ).

Kind regards,
Jörg-Michael

from abap-cleaner.

jmgrassau avatar jmgrassau commented on September 27, 2024 1

Hi ConjuringCoffee,

this issue should now be fixed with version 1.5.1!

Kind regards,
Jörg-Michael

from abap-cleaner.

ConjuringCoffee avatar ConjuringCoffee commented on September 27, 2024

Great, thank you!

from abap-cleaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.