Deoplete.nvim: Question: How to make deoplete use all sources for PHP including Omni ?

Created on 9 Jan 2016  路  12Comments  路  Source: Shougo/deoplete.nvim

I have _phpcd.vim_ installed and I can confirm it's working using ctrl-x xtrl-o.
However, I cannot make deoplete show the Omni-completion results including other sources (like: buffer, file, UltiSnips, etc.).

If I put the following in my _init.vim_, I get ONLY Omni-completion.

   let g:deoplete#omni_patterns = {}
   let g:deoplete#omni_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'

If I remove the above lines I get all other sources except Omni-completion.

I have also tried the following in my _init.vim_. However, I get an error from _deoplete_

   Plug 'Shougo/deoplete.nvim'

   let g:deoplete#enable_at_startup = 1
   let g:deoplete#auto_completion_start_length = 1

  "Note that -> added
   let g:deoplete#delimiters = ['/', '.', '::', ':', '#', '->']

   let g:deoplete#sources = {}
   let g:deoplete#sources._=['omni', 'buffer', 'member', 'tag', 'ultisnips', 'file']

   let g:deoplete#omni#input_patterns = {}
   let g:deoplete#omni#input_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'

I know that the last line causes the error. However, I don't know _python_ nor I know _python regex_ to fix it.
Could you please elaborate on what I am doing wrong and tell me how to fix it?

Most helpful comment

@cprn: I just hate it when linked information disappears. My dotfiles are not going to go anywhere. I have disabled all the settings, just keeping let g:deoplete#enable_at_startup = 1 while having m2mdas/phpcomplete-extended installed and it just works now: https://github.com/herrbischoff/dotfiles/blob/2f8617273bdef5795791b2821c7c2df2ef2c2dcc/home/.config/nvim/plugins.vim#L134-L164

All 12 comments

@khalidchawtany
here is my confic ,I can get all source for java,I think you can change to what you want.

https://github.com/wsdjeg/DotFiles/blob/master/vimrc#L655-L672

@wsdjeg Thanks your config works for PHP too.

you are welcome

The working configuration disappeared. Could you please post the relevant parts in this issue?

@wsdjeg Thanks!

Reupload or paste here?

@cprn: I just hate it when linked information disappears. My dotfiles are not going to go anywhere. I have disabled all the settings, just keeping let g:deoplete#enable_at_startup = 1 while having m2mdas/phpcomplete-extended installed and it just works now: https://github.com/herrbischoff/dotfiles/blob/2f8617273bdef5795791b2821c7c2df2ef2c2dcc/home/.config/nvim/plugins.vim#L134-L164

phpcomplete-extended has its own issues but default config seems to work. Thanks!

@herrbischoff Yeah... your config ghosted and I can't seem to get omni completion to work again.

@cprn: Damn. That really should not have happened. I'm going to update it during the next couple of hours.

@cprn: I updated the link to a proper one, referencing the repo at the time in history I wrote the comment. This way, it should not disappear again, no matter what happens.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tchia04 picture tchia04  路  3Comments

iscekic picture iscekic  路  6Comments

marcus picture marcus  路  6Comments

pappasam picture pappasam  路  4Comments

westlywright picture westlywright  路  6Comments