Git Product home page Git Product logo

Comments (2)

PhilippSalvisberg avatar PhilippSalvisberg commented on May 28, 2024

I see the issue for these two lines, because the overall linesize exceeds the defined value of 120 chars. Splitting long lines is something done outside of the Arbori program. I cannot say why there is not split for the first line and the splitting of the second line occurs a bit late. Anyway, we can influence the behaviour only indirectly. By changing the max. line size or adding line breaks when we assume (somehow) that the line will be too long. That's probably doable using the same approach as for #33.

        l_some_long_named_variable_rec.some_primary_item_id      := p_input_obj.items(i).some_nested_element_array(j).some_primary_item_id;
        l_some_long_named_variable_rec.some_other_key_element    := get_some_other_key_element(p_input_obj.items(i).some_nested_element_array(

However, the the behaviour for the following line is completely OK IMO.

        l_some_long_named_variable_tab(j)                        := l_some_long_named_variable_rec;

I don't think it's a good idea to add a line break regardless of the line size after the :=.

from plsql-formatter-settings.

PhilippSalvisberg avatar PhilippSalvisberg commented on May 28, 2024

After closing the #33 the result looks like this:

declare
   function transform_cancel_rec (
      p_input_obj some_obj_type
   ) return return_rec is
      l_return_rec                    return_rec;
      l_some_rec                      some_rec_type;
      l_some_tab                      some_tab_type;
      l_some_long_named_variable_rec  some_record_type;
      l_some_long_named_variable_tab  some_table_type;
   begin
      l_return_rec.some_primary_id := p_input_obj.primary_id;
      for i in 1..p_input_obj.items.count loop
         l_some_long_named_variable_tab := some_table_type();
         for j in 1..p_input_obj.items(i).some_nested_element_array.count loop
            l_some_long_named_variable_rec.some_primary_item_id := p_input_obj.items(i).some_nested_element_array(
            j).some_primary_item_id;
            l_some_long_named_variable_rec.some_other_key_element :=
               get_some_other_key_element(
                  p_input_obj.items(i).some_nested_element_array(j).some_sun_element_id
               );
            l_some_long_named_variable_tab.extend();
            l_some_long_named_variable_tab(j) := l_some_long_named_variable_rec;
         end loop;
         l_some_rec.items := l_some_long_named_variable_tab;
         l_some_tab.extend();
         l_some_tab(i) := l_some_rec;
      end loop;
      l_return_rec.items := l_some_tab;
      return l_return_rec;
   end;
begin
   null;
end;
/

This is better. Only

            l_some_long_named_variable_rec.some_primary_item_id := p_input_obj.items(i).some_nested_element_array(
            j).some_primary_item_id;

should be splitted. The estimation for the line size does not include the left part of the assignment statement. Adding this should solve the problem.

from plsql-formatter-settings.

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.