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

Multiple instances of the same autocompletion recommendation #53

Open
bratpeki opened this issue Mar 9, 2021 · 8 comments
Open

Multiple instances of the same autocompletion recommendation #53

bratpeki opened this issue Mar 9, 2021 · 8 comments

Comments

@bratpeki
Copy link

bratpeki commented Mar 9, 2021

Preview:

image

Issue: Vim instantiates 4 instances of the same recommendation for autocompletion.
Platform: Windows 10
Editor: GVim 8.2

@bratpeki
Copy link
Author

bratpeki commented Mar 9, 2021

Update:

image

Vim offers quadruple keywords (using, using, using, using) and single statements (using).

@kit494way
Copy link

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

@yatli
Copy link
Member

yatli commented Mar 11, 2021

😱 it spawned 4 language servers

@kit494way
Copy link

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.

@bratpeki
Copy link
Author

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?

@kit494way
Copy link

This change of coc.nvim is related.
neoclide/coc.nvim@190ebfc

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.

@C-Rmoser
Copy link

Having the exact same problem. I'm also using windows. Let me know if you find a solution please.

@C-Rmoser
Copy link

C-Rmoser commented Mar 16, 2021

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 dld :call Disable_ls_duplicates()

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

4 participants