Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ddc.vim source #790

Closed
gabriel-gardner opened this issue Jun 23, 2022 · 3 comments
Closed

Add a ddc.vim source #790

gabriel-gardner opened this issue Jun 23, 2022 · 3 comments

Comments

@gabriel-gardner
Copy link

gabriel-gardner commented Jun 23, 2022

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
Copy link
Member

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
Copy link
Author

gabriel-gardner commented Jun 24, 2022

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
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants