mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

Setting filetype to 'javascript.jsx' is not good idea #183

Closed daliusd closed 2 years ago

daliusd commented 5 years ago

I found that that this plugin change *.js filetype to 'javascript.jsx' and that breaks tern_for_vim and autocomplete-flow plugins as they expect 'javascript' filetype to work properly. Maybe proper way would be to fix these two plugins but who knows how many more plugins are out there that expect "javascript" filetype.

yuezk commented 5 years ago

@daliusd You can try MaxMEllon/vim-jsx-pretty, which was inspired by vim-jsx initially but it doesn't change the filetype of the js files. It makes many efforts to improve the syntax highlighting and indenting.

I admit that vim-jsx is a great plugin but it depends on the xml syntax highlighting which doesn't compatible with the jsx syntax completely. While the vim-jsx-pretty implemented the JSX syntax specification with no dependency and many corner test cases covered.

daliusd commented 5 years ago

@yuezk That's what I'm actually using now. I have reported this only to help others to figure out why something has stopped working or is not working at all.

seabornlee commented 2 years ago

My .js file not automatically indent when insert new line. After removing vim-jsx plugin, it works again.

daliusd commented 2 years ago

Lastly I have migrated to tree-sitter.