Here's a trivial example of code that DocumentFormat.jl doesn't handle in any way (doesn't even indent correctly):
function example(a, b, c)
a(b, "first",
c,
"third",
"fourth")
end
I would expect either:
function example(a, b, c)
a(b, "first", c, "third", "fourth")
end
If the formatted line is within margins, or
function example(a, b, c)
a(b,
"first",
c,
"third",
"fourth")
end
if it doesn't. More sophisticated algorithms could do something like this as well
function example(a, b, c)
a(b, "first", c,
"third", "fourth")
end
Even if we have the option of "not touching line breaks" (which is also controversial), I would expect this result:
function example(a, b, c)
a(b, "first",
c,
"third",
"fourth")
end
And this should be done for any kind of sequences, including arguments, export clauses etc, possibly with a separate enable/disable option for each.
By the way I am not making this stuff up, I've seen it working many times. Every language I have ever used had a least one formatter tool which supported this (including Juila, which has this supported in JuliaFormatter.jl)
Here's a trivial example of code that DocumentFormat.jl doesn't handle in any way (doesn't even indent correctly):
I would expect either:
If the formatted line is within margins, or
if it doesn't. More sophisticated algorithms could do something like this as well
Even if we have the option of "not touching line breaks" (which is also controversial), I would expect this result:
And this should be done for any kind of sequences, including arguments, export clauses etc, possibly with a separate enable/disable option for each.
By the way I am not making this stuff up, I've seen it working many times. Every language I have ever used had a least one formatter tool which supported this (including Juila, which has this supported in
JuliaFormatter.jl
)