openscad-LSP
openscad-LSP copied to clipboard
Formatting should not sort includes
Hi Leathong, thanks for creating this LSP and the VSCode extension. Just started using it today and it has been very helpful!
I ran the built-in formatter and noticed that it sorts includes. This can break programs because the order matters.
i.e. I use NopSCADlib which has a file utils/fans.scad
that implicitly depends on utils/screws.scad
. Putting screws.scad
after fans.scad
in the include order breaks the build.
- Formatting commit: https://github.com/sameer/models/commit/adc5244a946a031d7a012ff109fc7aa18bd81585
- Undo sorting commit: https://github.com/sameer/models/commit/c486dca2959d0adb29466786d2dc08ec4f3756b6
You can customized a .clang-format file for this. Formatting function simply calls clang-format.