yats.vim
yats.vim copied to clipboard
Arrow function destructuring broken when given type and when first argument.
Strange behavior here.
Here's an example..
Works fine
const x = foo((foo, { foo }: foo) => {});
Broken
const x = foo(({ foo }: foo, foo) => {});
Tried to take a stab at it, but couldn't figure it out.
Might be related to #97, would you mind trying my fork? I have a WIP version for destructuring parameters
Open a pull request and I'll pull it down and try it.
Though I will say that your branch sounds to be more ambitious than this issue. The issue I'm reporting here only occurs when the object being destructured is the first parameter. If it's any other parameter, it works fine (for my purposes)
I found the same issue and made a test file: https://gist.github.com/mikebolt/c596d5ac9a101071ef13c1bb80c8d8ca
The code in the arrow function in foo is formatted incorrectly, but the code in the arrow function in bar is formatted correctly. The only difference is that the argument is destructured in foo.