Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting broken when a class lambda returns a single JSX tag not enclosed in parentheses #1073

Open
naveg opened this issue Nov 2, 2017 · 1 comment

Comments

@naveg
Copy link

naveg commented Nov 2, 2017

See mxw/vim-jsx#148 - this is some discussion of this being an issue with vim-javascript, not vim-jsx

screenshot-2017-11-01_14 11 20

const MyFunctionalComponent = () =>
  <div className="MyFunctionalComponent">
    My highlighting also works!
  </div>


                
class MyComponent extends React.Component {
  render = () =>
    <div className="MyComponent">
      My highlighting is broken
    </div>
}

class MyParensComponent extends React.Component {
  render = () => (
    <div className="MyParensComponent">
      My highlighting works!
    </div>
  )
}

Here's a modified plugin section of my vimrc. The bug reproduces with a vimrc consisting of this snippet only.

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')

Plug 'pangloss/vim-javascript', {'for': ['javascript', 'javascript.jsx']}
Plug 'mxw/vim-jsx', {'for': ['javascript', 'javascript.jsx']}

call plug#end()
@bounceme
Copy link
Collaborator

bounceme commented Nov 2, 2017

babel/babylon#540 (comment) hopefully this will solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants