completor.vim icon indicating copy to clipboard operation
completor.vim copied to clipboard

Omni Trigger for Javascript

Open amadeus opened this issue 8 years ago • 4 comments

So I have omni completion setup for Javascript via Flow, and I'd prefer to not use the built in Tern system.

I am trying to setup an omni trigger for javascript like so:

let g:completor_javascript_omni_trigger = "\w+$|[\w\\)\]\}\'\"]+\.\w*$"

This is based on the built in trigger for Tern, however it doesn't appear to work. I still have to press <c-x><c-o> to bring up omni completions.

As a side note, I am also using filetypes of javascript.jsx, not sure if this has any affect.

amadeus avatar Oct 05 '17 21:10 amadeus

Updating to the latest commit and setting the following trigger may fix the problem:

let g:completor_javascript_omni_trigger = "\\w+$|[\\w\\)\\]\\}\'\"]+\\.\\w*$"

maralla avatar Oct 06 '17 12:10 maralla

This seems to work well, thanks!

The only other thing I've found though, is that getting the omnicomplete results locks up the UI for a few milliseconds. Is this just a limitation in Vim? Or is there a way that Completor could return the omnicomplete results asynchronously?

amadeus avatar Oct 06 '17 18:10 amadeus

Currently the omnicomplete results are computed using the current vim instance synchronously. And right now I can't find a proper way to do this asynchronously. So maybe it's better to implement the completer using other language and running the completer in a different process asynchronously.

maralla avatar Oct 18 '17 03:10 maralla

Ahh yeah, make sense. Personally I would really like Flow support, however I did try taking a stab at it a while back, but I was never able to get it to work quite right.

amadeus avatar Oct 19 '17 07:10 amadeus