OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

ddc-ultisnips error #843

Closed psuong closed 1 year ago

psuong commented 1 year ago

Hi there,

I'm wondering how I can write a ddc completion source or extend this: https://github.com/gabriel-gardner/ddc-omnisharp-vim with ultisnips support.

Currently I get the following issue: image

I'm not sure where to begin but the plugins I'm using for ddc are:

Plug 'Shougo/ddc.vim'
Plug 'Shougo/ddc-ui-native'
Plug 'vim-denops/denops.vim'
Plug 'gabriel-gardner/ddc-omnisharp-vim'
Plug 'Shougo/ddc-matcher_head'
Plug 'Shougo/ddc-sorter_rank'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'matsui54/ddc-ultisnips'
Plug 'OmniSharp/omnisharp-vim'

This occurs when I define

" ----------------------------------------------------------------------
" Configs for ddc 
" ----------------------------------------------------------------------
call ddc#custom#patch_global('ui', 'native')

" Source ddc configs
" ----------------------------------------------------------------------
call ddc#custom#patch_global('sources', ['omnisharp-vim', 'ultisnips'])

call ddc#custom#patch_global('sourceOptions', #{
    \ _: #{ 
    \    matchers: [ 'matcher_head' ],
    \    sorters: ['sorter_rank' ]
    \ },
    \ ultisnips: #{ mark: 'US' },
    \ omnisharp-vim: #{ mark: 'OMNI' },
    \ })

" Enable ddc
" ----------------------------------------------------------------------
call ddc#enable()

" Ultisnips configs
" ----------------------------------------------------------------------
let g:UltiSnipsExpandTrigger="<c-o>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"

" OmniSharp snippet
let g:OmniSharp_want_snippet = 1

in my init.vim (neovim).

psuong commented 1 year ago

Actually interesting, that if I set let g:OmniSharp_want_snippet=1 on runtime for neovim, wanting snippets ends up working. Maybe things were just initialized in the wrong order?

I'll see if I can look into plugin initialization order with omnisharp and ddc.