mxw / vim-jsx

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

g:jsx_ext_required breaks with deoplete.nvim autocompletion #68

Closed ahmedelgabri closed 9 years ago

ahmedelgabri commented 9 years ago

let g:jsx_ext_required = 0 breaks deoplete.nvim autocompletion, more info in this issue https://github.com/Shougo/deoplete.nvim/issues/44

mxw commented 9 years ago

What is "deoplete.nvim autocompletion"?

There is nothing magical about g:jsx_ext_required—it's just that, if that's the only config you set manually, then the behavior will be that *.js files will have filetype set to javascript.jsx, and will have JSX syntax/indent enabled. (The default behavior, without manual config, is to only change the filetype and enable things for *.jsx files.)

Most likely, the plugin you're using doesn't handle filetype matching correctly in the presence of multiple filetypes (e.g., html.css.php, or javascript.jsx). Don't see how this is an issue here, but let me know if you are able to confirm otherwise.

mxw commented 9 years ago

(Also, perhaps deoplete doesn't work correctly because vim-jsx's ftdetect is happening in after/ order?)

EDIT: I just updated vim-jsx to move the ftdetect outside of after/, so if you pull the latest version, this should no longer be an issue.

ahmedelgabri commented 9 years ago

What is "deoplete.nvim autocompletion"?

I assume you didn't check the link to the issue on that repo :), it's an asynchronous completion framework for neovim. So when I set this option it conflicts somehow with deoplete and the autocomplete doesn't get triggered automatically.

There is nothing magical about g:jsx_ext_required—it's just that, if that's the only config you set manually, then the behavior will be that .js files will have filetype set to javascript.jsx, and will have JSX syntax/indent enabled. (The default behavior, without manual config, is to only change the filetype and enable things for .jsx files.)

I can't change all the files in every project to .jsx

EDIT: I just updated vim-jsx to move the ftdetect outside of after/, so if you pull the latest version, this should no longer be an issue.

This didn't fix the problem.

Most likely, the plugin you're using doesn't handle filetype matching correctly in the presence of multiple filetypes (e.g., html.css.php, or javascript.jsx). Don't see how this is an issue here, but let me know if you are able to confirm otherwise.

Will see if I can check this issue.

Anyway it's not really a big thing, but it's definitely a nice to have when you deal with JSX code inside .js files.

mxw commented 9 years ago

Nah—the link to the issue just doesn't really describe what deoplete is (or why this wouldn't be an issue with deoplete).

Shougo commented 9 years ago

@mxw Sorry, I think it is not vim-jsx problem. But I cannot reproduce the problem in the minimal environment. I think @ahmedelgabri 's infromation was something wrong. @ahmedelgabri should provide the correct information.

Shougo commented 8 years ago

This problem is deoplete problem. It is fixed. Sorry.