lua-fmt
lua-fmt copied to clipboard
Tables with linebreaks become inline
For example:
local limits = {
{
inf = radRef + rad,
mid = radRef + rad - radT,
sup = radRef + 0.5 * rad,
},
{
inf = radRef + 0.5 * rad,
mid = radRef + radT,
sup = radRef,
},
}
becomes
local limits = {{inf = radRef + rad, mid = radRef + rad - radT, sup = radRef + 0.5 * rad}, {inf = radRef + 0.5 * rad, mid = radRef + radT, sup = radRef}}
return {
updateFn = updateFn,
params = params
}
becomes
return {updateFn = updateFn, params = params}
This bug can be extended for similar case like:
return group
* pipe.map(pipe.map(fMake))
* pipe.flatten()
* pipe.flatten()
* pipe.flatten()
become
return group * pipe.map(pipe.map(fMake)) * pipe.flatten() * pipe.flatten() * pipe.flatten()
or
local upperPolys = pipe.new
+ junction.generatePolyArc(group1.upper.walls, "inf", "mid")(0, 0)
+ junction.generatePolyArc(group2.upper.walls, "mid", "sup")(0, 0)
becomes
local upperPolys = pipe.new + junction.generatePolyArc(group1.upper.walls, "inf", "mid")(0, 0) + junction.generatePolyArc(group2.upper.walls, "mid", "sup")(0, 0)
I think the table issue you were having was fixed a while ago, as I can't reproduce it. Can you verify with the latest version? In this case, the latest version of vscode-lua will suffice.
As for the pipe snippets, I think that is addressed in #15, or am I misreading that?