Strange indentation when assigning a function with a table argument to a variable
If I have a variable and assign the result of a function that receives a table to it, like this:
instance = MyClass.new({
stuff
})
...The formatted code looks like this. It's confusing to me how MyClass.new( has the same indentation level as the table that it's receiving:
instance =
MyClass.new(
{
arguments
}
)
I believe this would be the ideal result:
instance = MyClass.new(
{
arguments
}
)
I suspect this part and after adding more check to be like this
const canBreakLine = node.init.some(n =>
n != null &&
n.type !== 'TableConstructorExpression' &&
n.type !== 'FunctionDeclaration' &&
n.type !== 'CallExpression'
);
the result is as you expect
instance = MyClass.new(
{
arguments
}
)
adding checkCallExpression is just come from hard debugging and I don't understand how it's actually works 🤔
Ooh, nicely done, @Arpple! Do you wanna open a pull request for that? Since you're not sure how it works, maybe we should get @trixnz's opinion first, though.