JuliaFormatter.jl
JuliaFormatter.jl copied to clipboard
formatting multi-line matrices
One cool thing about Julia is that we can write a matrix as:
R = @SMatrix[ cosθ -sinθ
sinθ cosθ ]
However, the JuliaFormatter keeps transforming that to:
R = @SMatrix[cosθ -sinθ
sinθ cosθ]
Maybe there is an easy fix?
what are the config file/options you're using
I'm using the default options shipped with VSCode and the Julia extension. I'm trying to check that, but for now I can't find any option.
the default style that comes with vscode is MinimalStyle which keeps the lines where they are as much as possible but the indent is based on indent of X (default 4 spaces). If you want the indent to align to the opening (, {, [ then I suggest you try out YASStyle or SciMLStyle and see if that works better for you.
It's possible MinimalStyle will adopt an adaptive indent but that's probably quite a bit of work