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

Highlight for ES6's import #21

Closed lazywei closed 9 years ago

lazywei commented 9 years ago

Hi,

I'm using ES6's import, and I found the highlight seems be a little wrong (the string part), here is the screenshot:

image

Also, a little off-topic, but the inline arrow function seems to lack of highlighting (the this.transitionTo ... line)

Thanks.

othree commented 9 years ago

Hi You are writing jsx format file, and yajs didn't support it natively. 2015年3月13日 下午5:26 於 "Chih-Wei Chang" notifications@github.com 寫道:

Hi,

I'm using ES6's import, and I found the highlight seems be a little wrong (the string part), here is the screenshot:

[image: image] https://cloud.githubusercontent.com/assets/2840571/6635903/ce005112-c9a5-11e4-848b-878f771c90b0.png

Also, a little off-topic, but the inline arrow function seems to lack of highlighting (the this.transitionTo ... line)

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/othree/yajs.vim/issues/21.

lazywei commented 9 years ago

But I thought after using mxw/vim-jsx, vim will recognize jsx file as a superset of javascript, which should make the yajs works as expected? Thanks.

othree commented 9 years ago

Yes, but your arrow function is inside jsx's scope. Where javascript syntax can't reach unless jsx syntax have rule for it.

lazywei commented 9 years ago

OK, I understand. But I'm wondering if there is any suitable solution for this situation? Thanks.

othree commented 9 years ago

Try https://github.com/othree/vim-jsx

othree commented 9 years ago

If you have any test result of mime vim-jsx patch. Please let me know. I am going to send PR back.

lazywei commented 9 years ago

It seems your fork still doesn't highlight the arrow function and the import modules.

lazywei commented 9 years ago

Sorry, my fault. The arrow function does be highlighted correctly! awesome, and thanks! But the import modules' strings are not still.

othree commented 9 years ago

I think there are two issues here. Import is one. Arrow function in jsx is another :)

2015-03-17 11:33 GMT+08:00 Chih-Wei Chang notifications@github.com:

Sorry, my fault. The arrow function does be highlighted correctly! awesome, and thanks! But the import modules' strings are not still.

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

OOO

lazywei commented 9 years ago

awesome! I confirmed that both issues are fixed now :+1: