othree / yajs.vim

YAJS.vim: Yet Another JavaScript Syntax for Vim
http://www.vim.org/scripts/script.php?script_id=4974
Vim License
688 stars 41 forks source link

es7+ bind/static #55

Closed vm closed 9 years ago

vm commented 9 years ago

I am trying to do some similar code to React's class initializers:

export class Counter extends React.Component {
  static propTypes = { initialCount: React.PropTypes.number };
  static defaultProps = { initialCount: 0 };
  state = { count: this.props.initialCount };
  tick() {
    this.setState({ count: this.state.count + 1 });
  }
  render() {
    return (
      <div onClick={this.tick.bind(this)}>
        Clicks: {this.state.count}
      </div>
    );
  }
}

source: https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#es7-property-initializers

However, I am unable to properly get the syntax highlighting to work with this. Here is the difference between when statics are used and when they are not:

screenshot 2015-08-31 09 45 53 screenshot 2015-08-31 09 46 01

othree commented 9 years ago

Discussed in #50 Implemented in another repo.

vm commented 9 years ago

Sorry, wasn't able to figure out from that repo's README. Should my vimrc have:

Plug 'othree/yajs.vim' Plug 'othree/es.next.syntax.vim'

Or is there some other order I need for this to work? Thanks again!

othree commented 9 years ago

Yes It don't need configure. Just install it using vundle.

Let me know if not work.

2015-08-31 17:47 GMT+08:00 Vignesh Mohankumar notifications@github.com:

Sorry, wasn't able to figure out from that repo's README. Should my vimrc have:

Plug 'othree/yajs.vim' Plug 'othree/es.next.syntax.vim'

Or is there some other order I need for this to work? Thanks again!

— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/55#issuecomment-136317680.

OOO

vm commented 9 years ago

This didn't work. Is there something specific about Vundle that would make this work versus Plug?

othree commented 9 years ago

Not implement static property now. Working on it

2015-08-31 22:06 GMT+08:00 Vignesh Mohankumar notifications@github.com:

This didn't work. Is there something specific about Vundle that would make this work versus Plug?

— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/55#issuecomment-136381092.

OOO

othree commented 9 years ago

Fixed

2015-09-01 18:50 GMT+08:00 OOO othree@gmail.com:

Not implement static property now. Working on it

2015-08-31 22:06 GMT+08:00 Vignesh Mohankumar notifications@github.com:

This didn't work. Is there something specific about Vundle that would make this work versus Plug?

— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/55#issuecomment-136381092.

OOO

OOO

vm commented 9 years ago

Interesting, still not really working for me.

screenshot 2015-09-01 10 40 53

Can you show me an image of what that code sample looks like in your vim?

othree commented 9 years ago

I use the code you provide Do you update es.next.syntax.vim

2015-09-01 22:40 GMT+08:00 Vignesh Mohankumar notifications@github.com:

Interesting, still not really working for me.

[image: screenshot 2015-09-01 10 40 53] https://cloud.githubusercontent.com/assets/4899429/9607187/c151ace6-5095-11e5-9062-8c9528f45644.png

Can you show me an image of what that code sample looks like in your vim?

— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/55#issuecomment-136744719.

OOO

vm commented 9 years ago

Works! Sorry, forgot to update. Thanks so much for the change.