OmniSharp / omnisharp-vim

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

Add a ddc.vim source #790

Closed gabriel-gardner closed 2 years ago

gabriel-gardner commented 2 years ago

I recently switched to using Shougo/ddc.vim for autocomplete given it's cutting-edge design and better integration with Copilot. It would be awesome if someone could try their hand at writing a source for it, I tried for a few hours but don't know Vimscript or Typescript well enough to effectively implement.

I shouldn't imagine it'd be too hard to adapt from the Deoplete source but I was having a hard time getting good return values from Omnisharp#actions#complete#Get and using Typescript's await/promise system. I can share my Frankenstein code if helpful (private repo so no one accidentally adds it to vim). Perhaps there is someone who is more familiar with the languages who can give it a go!

nickspoons commented 2 years ago

Hi @gabriel-gardner, yeah share your Frankenstein repo, I'll take a look. No promises though, I'm spending the extra time I find at the moment on the test runner (#789 )

gabriel-gardner commented 2 years ago

Awesome, thanks @nickspoons! Here is the repo: gabriel-gardner/ddc-omnisharp-vim. I basically just tried to mimic the python deoplete source since the ddc.vim system looks similar as it's by the same author.

Another simple ddc source example is here for ultisnips.

Note that I don't have deoplete installed anymore so I had to delete the call to call deoplete#auto_complete() in omnisharp.vim.

If it's helpful, let me know and I can share my ddc.vim config from my vimrc (although it's very simple).

gabriel-gardner commented 2 years ago

So I managed to get it working! I'm still not sure if the way I'm calling Omnisharp#actions#complete#Get without passing in a callback could potentially slow things down based on your vimscript implementation. But it is called asynchronously from the typescript and it seems to be running smoothly for me.

Could be helpful if you gave it a look but it appears to be working fine so I will close this issue. Cheers!