[OpenSCAD] User Poll: What do you want to see from OpenSCAD development?

Hans L thehans at gmail.com
Sun Nov 10 01:39:51 EST 2019


On Sat, Nov 9, 2019 at 10:33 PM John Lussmyer <Cougar at casadelgato.com> wrote:
> What I would like is the editor to be syntax aware

In what way?  Syntax highlighting has been in for a while.  And
auto-completion was added recently, available in the nightly version.
Or something more?

>, and be able to format the code easily.

Not sure if this helps, but one trick that many might not know about
is if you click menu "Design" -> "Display AST..."  it will open a
separate window with a consistently formatted version of your scad
file, created by parsing the script and reconstructing the text from
the Abstract Syntax Tree.
It isn't exactly intended for "pretty-printing", and so has a few
quirks lke reordering the overall layout as: functions definitions
first, then modules definitions, then variable declarations and module
calls(top-level code).
Also it will strip comments that aren't part of customizer parameters.
Besides those things the output should be functionally equivalent, and
I have found it useful on occasion to quickly make nice indented,
legible output from some spaghetti code.

Hans



More information about the Discuss mailing list