Script formatter doesn't properly format lines with multiple ends/statements on them

As of version 0.445.1.410643, the code editor has a formatting option. It works great, but when a line has multiple end keywords or multiple statements on it, it doesn’t format them properly, and instead leaves them all on one line.

I suppose that this may be intentional, but it was unexpected while I was messing around with it, so I’m hoping it’s a bug.

To replicate the issue, just put code like this into the editor and format it:

local function foo(bar)
if bar then
local baz = Instance.new("Part") baz.Position = Vector3.new(1, 2, 3) baz.Parent = workspace
end end

Observe that, while it indents things properly, it doesn’t move all of the statements onto their own lines (this would be ideal) and it doesn’t move all the ends onto their own line. My expectation was that the formatter would do these things.

2 Likes

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.