omnisharp-roslyn icon indicating copy to clipboard operation
omnisharp-roslyn copied to clipboard

Duplicate `client/registerCapability` requests

Open kit494way opened this issue 4 years ago • 4 comments

It seems like client/registerCapability requests with same id are sent multiple times from v1.37.7.

There is a warning from OmniSharp which is not output in v1.37.6.

[Warn - 11:58:26 PM] OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.Client.OutgoingNotification | @Request='OmniSharp.Extensions.JsonRpc.Client.OutgoingNotification'

When I tried to use omnisharp-roslyn from neovim with coc-omnisharp, I have the issue https://github.com/coc-extensions/coc-omnisharp/issues/53 . I think duplicate client/registerCapability requests is the one of the causes of the issue.

kit494way avatar Mar 22 '21 15:03 kit494way

I have the same issue, every capability is registered twice.

It has consequences on the client side: Capture d’écran du 2021-09-17 15-44-51

CGNonofr avatar Sep 17 '21 13:09 CGNonofr

Same issue here, any news on this one?

C-Rmoser avatar Oct 11 '21 12:10 C-Rmoser

Same issue here.

Additionally, the omnisharp server sends diagnostics to the client even though it has not send initialized yet. Might be also related to this problem.

janivo avatar Oct 12 '21 09:10 janivo

This is still an issue in omnisharp v1.39.11 below is the workaround

const existingRegistrations = new Set<string>()
...
if (message.method === 'client/registerCapability'){
    message.params.registrations = message.params.registrations.filter((registration:any) => {
         return !existingRegistrations.has(registration.id)
    })
    message.params.registrations.forEach((registration:any) => {
       existingRegistrations.add(registration.id)
     })
}

Namanl2001 avatar Mar 13 '24 19:03 Namanl2001