HerringtonDarkholme / yats.vim

Yet Another TypeScript Syntax: The most advanced TypeScript Syntax Highlighting in Vim
Vim License
651 stars 67 forks source link

Arrow function syntax broken #128

Open yuezk opened 5 years ago

yuezk commented 5 years ago

The reproducible code:

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

image

Vanuan commented 4 years ago

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

image

Vanuan commented 4 years ago

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

Vanuan commented 4 years ago

image

jeffvandyke commented 4 years ago

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