noahfrederick / vim-laravel

Vim support for Laravel/Lumen projects
159 stars 7 forks source link

Other completion managers #12

Open FatBoyXPC opened 5 years ago

FatBoyXPC commented 5 years ago

Is there any planned support for other completion managers, such as Deoplete?

FatBoyXPC commented 5 years ago

FWIW I'd be more than happy to try and learn how to add a deoplete bridge for this but I'd probably want some direction first.

noahfrederick commented 5 years ago

FWIW I'd be more than happy to try and learn how to add a deoplete bridge for this but I'd probably want some direction first.

I'm definitely open to adding support, but I'm unlikely to take this on for plug-ins I don't actively use.

If you (a) understand how to register Deoplete sources (I don't) and (b) look at the existing ncm example, it should be very straightforward.

Take a look at the two existing completion sources and where they're registered. I imagine Deoplete requires a similar incantation.

FatBoyXPC commented 5 years ago

I don't understand how to register Deoplete sources, but I'll take a look!

sharethewisdom commented 5 years ago

I use mucomplete which cycles native completion methods. I haven't properly used your plugin, and I haven't looked at this in detail, but I imagine I'd like to set something like

let g:mucomplete#chains.php  = ['laravel-routes', 'laravel-views', 'omni', 'file']
  let g:mucomplete#can_complete.php = {
    \ 'lavarel-routes': { t -> t =~ '\broute\([''"]' },
    \ 'lavarel-view: { t -> t =~ '@(component|extends|include)\([''"]' },
    \ 'file': { t -> t =~ '\f\f$' }}

where can_complete is a "dictionary defining the conditions that must be satisfied for a given method to be tried".

It should not be too difficult to add functions for a mucomplete user method. I'll take a look when I have time.

FatBoyXPC commented 5 years ago

I completely forgot about this issue and I've since moved to ncm2. I likely won't be writing that Deoplete bridge now.

PS: It looks like I'm not getting insert mode completion in ncm2, but I might not have something setup right. Is ncm2 expected to work with this?

noahfrederick commented 5 years ago

PS: It looks like I'm not getting insert mode completion in ncm2, but I might not have something setup right. Is ncm2 expected to work with this?

Unfortunately only the original NCM is supported. NCM2 support should be easy to add, but my attention has been elsewhere. I use it too, so it's something I want.

FatBoyXPC commented 5 years ago

I got the ncm2 stuff figured out. PR incoming soon!

noahfrederick commented 5 years ago

NCM2 support was added thanks to @FatBoyXPC.