michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

Flow type arguments at callsites in class bodies #43

Closed rattrayalex-stripe closed 4 years ago

rattrayalex-stripe commented 5 years ago

This flow language feature is broken in class bodies (and possibly elsewhere, I haven't looked):

screen shot 2019-02-28 at 2 40 39 pm

class Correct extends React.Component<MyProps> {
  myRef = React.createRef();

  render() {
    const {foo} = this.props;
    return null;
  }
}

class NotCorrect extends React.Component<MyProps> {
  myRef = React.createRef<HTMLDivElement>(); // This causes the problem!

  render() {
    const {foo} = this.props;
    return null;
  }
}
mgtitimoli commented 5 years ago

I can confirm it's also broken at function calls on every context (class body and everywhere else).

gastonmorixe commented 5 years ago

+1

michaelgmcd commented 5 years ago

The > character is the issue. When inspecting the TM scope, it seems like it's being treated as the > of an arrow function (meta.function.arrow.js) which seems to break all of the syntax highlighting until the next } (end of the make believe function. This might be a little tricky to debug, but I'll try to take a look when I can.

michaelgmcd commented 4 years ago

Please check that this was fixed in v0.0.24

rattrayalex-stripe commented 4 years ago

Yep, looks perfect!

Screen Shot 2019-09-11 at 8 34 59 AM