OmniSharp / omnisharp-vim

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

Omnisharp-vim not working with Ultisnips on Completion snippets after the coc-version update #808

Closed lubyrex closed 2 years ago

lubyrex commented 2 years ago

Result from CocInfo

versions

vim version: NVIM v0.6.0-dev+525-ge921e98ce node version: v16.16.0 coc.nvim version: 0.0.82-b9c208ef 2022-09-07 15:41:25 +0800 coc.nvim directory: C:\Users\youche\AppData\Local\nvim-data\plugged\coc.nvim term: vtpcon platform: win32

Log of coc.nvim

2022-09-18T14:46:23.183 INFO (pid:25580) [coc-git] - Looking for git in: git 2022-09-18T14:46:23.332 INFO (pid:25580) [plugin] - coc.nvim initialized with node: v16.16.0 after 302ms 2022-09-18T14:46:23.899 WARN (pid:25580) [sources] - Recreate source OmniSharp 2022-09-18T14:47:28.510 INFO (pid:25580) [attach] - receive notification: checkJsonExtension [] 2022-09-18T14:47:28.593 INFO (pid:25580) [services] - registered service "json" 2022-09-18T14:47:28.594 INFO (pid:25580) [services] - Json language server state change: stopped => starting 2022-09-18T14:47:30.199 INFO (pid:25580) [services] - Json language server state change: starting => running 2022-09-18T14:47:30.215 INFO (pid:25580) [services] - service json started 2022-09-18T14:51:52.778 INFO (pid:25580) [attach] - receive notification: showInfo []

Describe the bug

pressing control-n on the code completion window will escape out of the window while selecting the first completion option

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't reproduce it

call plug#begin(stdpath('data') . '/plugged') Plug 'OmniSharp/omnisharp-vim' Plug 'SirVer/ultisnips' Plug 'neoclide/coc.nvim' call plug#end()

let g:OmniSharp_want_snippet = 1 let g:OmniSharp_server_use_net6 = 1 let g:OmniSharp_timeout = 105 let g:OmniSharp_server_stdio = 1 let g:OmniSharp_completion_without_overloads=1



- Start (neo)vim with command: `vim -u mini.vim`

- Operate vim.

## Screenshots (optional)

https://user-images.githubusercontent.com/16534505/190896455-47272ebe-eea2-4fbc-a2ed-ff9d2030a17f.mp4

If applicable, add screenshots to help explain your problem.
nickspoons commented 2 years ago

The attached video is almost impossible to see. All I can (just) make out is that the completion is being selected and the first argument of the method is selected. That seems correct but as I say, I can see exactly what's happening.

Can you please explain what the problem is, what is happening, and what you expect to happen differently?

If you want to demonstrate with a screencast, I recommend asciinema which allows text selection of the "video" as well as consistent display.

lubyrex commented 2 years ago

thanks for to comment, and sorry for the blurry video. I will try to explain the situation.

after upgrading coc-nvim, with snippets enabled, hitting control-n while doing code completion expands the first selection and exits the completion window making it impossible to move down the completion list. Before this update, control-n scrolls down the list while expanding each completion option.

I have already submitted an issue in the coc repo: https://github.com/neoclide/coc.nvim/issues/4209

They have explained that coc is calling the complete() method while expanding the selection. I don't fully understand this. But is there a way to use snippets with coc and omnisharp-vim together?

nickspoons commented 2 years ago

But is there a way to use snippets with coc and omnisharp-vim together?

The short answer: No.

It looks like the latest release of coc they have entirely replaced the vim popup completion menu with a custom one built of popups/floating windows. I have no idea how to interact with this custom popup menu. If someone wants to have a go at getting this working they are most welcome to submit a PR but at this stage I don't see it happening.