coc-omnisharp
coc-omnisharp copied to clipboard
Multiple instances of the same autocompletion recommendation
Preview:
Issue: Vim instantiates 4 instances of the same recommendation for autocompletion. Platform: Windows 10 Editor: GVim 8.2
Update:
Vim offers quadruple keywords (using, using, using, using)
and single statements (using)
.
When I tried omisharp-roslyn v1.37.6, the duplication is 2, not 4. I also tried below, and got the same result.
{
"languageserver": {
"csharp": {
"command": "/opt/omnisharp-1.37.7/run",
"args": ["-lsp"],
"filetypes": ["cs"]
}
}
}
:CocList sources
shows duplicated sources.
* snippets-source [S] $ 90 snippets
* snippets [S] 90
* cs-4 [LS] . 99
* cs-3 [LS] . 99
* cs-2 [LS] . 99
* cs-1 [LS] . 99
* file [F] / 10
* buffer [B] 1
* around [A] 1
😱 it spawned 4 language servers
This may be a problem of coc.nvim. I tried with coc.nvim v0.0.78, then this issue did not happen. But with coc.nvim v0.0.80, this issue happened. I tried omnisharp-vim (this also uses omnisharp-roslyn), but the issue like this did not happen.
When I tried omisharp-roslyn v1.37.6, the duplication is 2, not 4. I also tried below, and got the same result.
{ "languageserver": { "csharp": { "command": "/opt/omnisharp-1.37.7/run", "args": ["-lsp"], "filetypes": ["cs"] } } }
:CocList sources
shows duplicated sources.* snippets-source [S] $ 90 snippets * snippets [S] 90 * cs-4 [LS] . 99 * cs-3 [LS] . 99 * cs-2 [LS] . 99 * cs-1 [LS] . 99 * file [F] / 10 * buffer [B] 1 * around [A] 1
Yup, disabling the three other language servers results in single autocompletion results. Any idea why multiple instances may be starting up?
This change of coc.nvim is related. https://github.com/neoclide/coc.nvim/commit/190ebfcef93bad77407225ca17072339570f2ddb
It seems like omnisharp-roslyn send multiple client/registerCapability requests, and multiple sources are added. Before the change of coc.nvim, multiple sources are created but only one source is added.
Having the exact same problem. I'm also using windows. Let me know if you find a solution please.
Since I didn't manage to solve the problem I wrote a small function to disable the duplicate sources and put it in my vimrc.
" Toggle duplicate LS sources function Disable_ls_duplicates() :call CocAction('toggleSource', 'cs-2') :call CocAction('toggleSource', 'cs-3') :call CocAction('toggleSource', 'cs-4') endfunction
" Map the function call
nnoremap