yats.vim icon indicating copy to clipboard operation
yats.vim copied to clipboard

Arrow function destructuring broken when given type and when first argument.

Open dsifford opened this issue 5 years ago • 3 comments

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.

dsifford avatar May 23 '19 16:05 dsifford

Might be related to #97, would you mind trying my fork? I have a WIP version for destructuring parameters

tomaskallup avatar May 23 '19 19:05 tomaskallup

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)

dsifford avatar May 23 '19 21:05 dsifford

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.

mikebolt avatar Jul 10 '19 19:07 mikebolt