omnisharp-roslyn
omnisharp-roslyn copied to clipboard
Duplicate `client/registerCapability` requests
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.
I have the same issue, every capability is registered twice.
It has consequences on the client side:

Same issue here, any news on this one?
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.
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)
})
}