vim-laravel icon indicating copy to clipboard operation
vim-laravel copied to clipboard

Other completion managers

Open FatBoyXPC opened this issue 5 years ago • 8 comments

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

FatBoyXPC avatar Feb 28 '19 16:02 FatBoyXPC

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.

FatBoyXPC avatar Mar 02 '19 02:03 FatBoyXPC

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.

noahfrederick avatar Mar 02 '19 03:03 noahfrederick

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

FatBoyXPC avatar Mar 02 '19 03:03 FatBoyXPC

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.

sharethewisdom avatar Jul 19 '19 12:07 sharethewisdom

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?

FatBoyXPC avatar Jul 19 '19 14:07 FatBoyXPC

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.

noahfrederick avatar Jul 19 '19 14:07 noahfrederick

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

FatBoyXPC avatar Jul 19 '19 19:07 FatBoyXPC

NCM2 support was added thanks to @FatBoyXPC.

noahfrederick avatar Jul 23 '19 12:07 noahfrederick