styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Make fallback auto-complete function configurable #46

Closed asermax closed 6 years ago

asermax commented 6 years ago

On the autocomplete definition for this plugin, the omnifunc is overwritten to allow css completion, but it does fallback to a secondary auto complete function when the cursor is not within a styles block.

The fallback idea is pretty good, but having it hardcoded to a certain complete function is troublesome for those of us that have a different auto completion plugin already set up. It would be nice to be able to configure this through an option.

fleischie commented 6 years ago

Hey, thanks for the issue.

I'll check, whether there is a more general solution to this particular issue (i.e. whether one can call the css completer in css regions but the default completer (whatever that is) in js/ts regions).

fleischie commented 6 years ago

@asermax Hi, could you check out the latest develop branch to see, whether it helped with your custom completer function?

I didn't really took the time to test anything except css-in-js and js-in-js. So if you find anything weird with the solution and/or have other information, just shoot. I'd appreciate it. :v:

asermax commented 6 years ago

@fleischie I gave a quick run and it seems to be working perfectly so far :ok_hand:. Thanks for the quick response!

For reference, I'm using the Tern for Vim completion function.

fleischie commented 6 years ago

Fixed in release v2.5.