Reproduction Steps
Using two or more :
or .
on the same line will cause the auto-formatting to display an incorrect result for arguments provided within the next lines.
Let’s say we have a sample class:
local class = {}
function class.recursive(foo, bar)
return class
end
You would then call the method recursive
of class
twice on the same line. Note that this isn’t limited to just recursive methods, this is just an example.
You would then provide arguments on proceeding lines after calling the method:
class.recursive().recursive(
"foo",
"bar"
)
Expected Behavior
Calling the method on one line, while providing arguments in the next lines within the parenthesis will format correctly:
class.recursive().recursive(
"foo", --> tab
"bar" --> tab
)
Actual Behavior
Calling the method on one line, while providing arguments in the next lines within the parenthesis will format incorrectly:
class.recursive().recursive(
"foo", --> no tab
"bar" --> no tab
)
Workaround
- Calling everything on one line:
class.recursive().recursive("foo", "bar")
- Skipping a line on the second method call:
class.recursive()
.recursive(
"foo",
"bar"
)
- Manually formatting the code
Here’s a video of some listed examples:
Issue Area: Studio
Issue Type: Display
Impact: Moderate
Frequency: Constantly