ncsaba / idea-openscad

OpenSCAD language plugin for the IntelliJ platform.
Apache License 2.0
28 stars 10 forks source link

[request] Code style: can format cascade transformations #92

Closed danielsan80 closed 2 years ago

danielsan80 commented 2 years ago

I'd like to set a formatting preference on cascade transformations.

Generally I use this style:

render()
color("red")
rotate([0,45,0])
translate([20,20,20])
cube([10,10,10])

color("green")
translate([10,10,10]
sphere(r=10);

becaouse is more readable (for me) in the native editor.

BUT the autoformatter applies this style:

render()
   color("red")
      rotate([0,45,0])
         translate([20,20,20])
            cube([10,10,10])

color("green")
   translate([10,10,10]
      sphere(r=10);

that is nicer in PhpStorm but less readable in the native editor.

ldenisey commented 2 years ago

Added a field "Indent cascading transformations" in Settings menu -> Editor -> Code style -> OpenSCAD -> Tabs and Indents. Capture d’écran 2022-07-25 120646 Capture d’écran 2022-07-25 120715

Will be released in version 2.2.0 coming soon.