maralla / completor.vim

Async completion framework made ease.
MIT License
1.32k stars 62 forks source link

Using Flow LSP #265

Open amadeus opened 5 years ago

amadeus commented 5 years ago

I'm interested in trying out the LSP support for Flow. This would mean 2 things

1) I'd like to disable Tern (I couldn't seem to figure out a way to do this in the docs - I'd like to still keep the other completers like buffer and filename intact). Maybe it's already disabled since I don't have a .tern-config or whatever?

2) Flow lsp is invoked via flow lsp and I'd like to set it up for javascript and javascript.jsx files.

I assume for a configuration I would do something like:

let g:completor_filetype_map = {
      \ 'javascript':   {'ft': 'lsp', 'cmd': 'flow lsp'},
      \ 'javascript.jsx':   {'ft': 'lsp', 'cmd': 'flow lsp'},
      \ }

Do I need both the javascript and javascript.jsx?

3) And finally - is there a way I can debug to ensure it's working properly?

maralla commented 5 years ago

I think it will work by just adding the file type map config. I tried with the following config for my environment:

let g:completor_filetype_map = {}
let g:completor_filetype_map.javascript = {'ft': 'lsp', 'cmd': '/home/maralla/Workspace/tmp/node/node_modules/.bin/flow lsp'}

and it worked very well.

Yes both the javascript and javascript.jsx should be added. To show the debug log just let g:completor_debug = 1 then tail the file located at /path/to/completor.vim/pythonx/completor.log.