openscad-support-vscode
openscad-support-vscode copied to clipboard
Formatting can get thrown off by * modifier
Minor formatting bug:
Take example (Google-style formatting)
union() {
difference() {
circle();
square();
}
}
circle();
Suppose you want to hide the last circle
, like:
union() {
difference() {
circle();
square();
}
}
*circle();
Formatting the file results in
union(){difference(){circle();
square();
}
}
*circle();
(workaround: make a dummy module hide()
, and use that instead of *
)
In fact there is no dedicated OpenSCAD formatting tool, the formatting function simply calls clang-format. So if the format is too different from the c language, it will not be formatted correctly. There is no good resolution for now, it is a big project.
I'll try a workaround, replacing the * modifier by a mark before formatting and restoring it after it was done.
ah, ok, I thought there was already some openSCAD special formatting sauce already. That sounds like a good workaround; same with the ! and # modifiers too?
All modifier characters are not handled for now, they can be processed by the same way.