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

Arrow function syntax broken

Open yuezk opened this issue 5 years ago • 4 comments

The reproducible code:

const checkHightlighting = check(({
  sixthVariable = `create ${myVariable}`
}) => {
  return 'hello, world';
});

image

yuezk avatar Aug 27 '19 02:08 yuezk

This appears to be an issue of parameter destructuring where default value contains typescriptBraces.

image

Vanuan avatar Jan 06 '20 04:01 Vanuan

Screenshot from 2020-01-06 07-18-22

Vanuan avatar Jan 06 '20 05:01 Vanuan

image

Vanuan avatar Jan 06 '20 05:01 Vanuan

Here's another case that fails for me, seems ternary related though:

var thing = {
    objectKey: (param) =>
        param.field === 'String' ? `${inTemplate}` : param.field ?? null,
    stringProp: true,
},

Interestingly, it works ok with javascript syntax (whichever one vim-polyglot provides) With either typescript or typescriptreact syntax type (shared in common I believe), it renders as such:

image

jeffvandyke avatar May 06 '20 18:05 jeffvandyke