mxw / vim-jsx

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

jsx omni completion #169

Open plexigras opened 6 years ago

plexigras commented 6 years ago

i'm not sure how hard it is to write a custom omnicomp function but i think it would be nice to have.

https://github.com/vim/vim/blob/master/runtime/autoload/htmlcomplete.vim

https://github.com/vim/vim/blob/master/runtime/autoload/javascriptcomplete.vim

chemzqm commented 6 years ago

The language server of typescript could do that, it requires parse syntax tree, but viml could hardly do that job.

plexigras commented 6 years ago

but viml could hardly do that job.

why is that?

the html completion itself has css and javascript completion for <style> and <script> tags and this would just be the reverse so html completion inside of javascritp

https://github.com/vim/vim/blob/master/runtime/autoload/htmlcomplete.vim#L175-L192

plexigras commented 6 years ago

but for now just adding setlocal omnifunc=htmlcomplete#CompleteTags to ~/.vim/ftplugin/jsx.vim is good enough.