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

Unregister before register capability with same id #2981

Closed
kit494way opened this issue Mar 21, 2021 · 3 comments
Closed

Unregister before register capability with same id #2981

kit494way opened this issue Mar 21, 2021 · 3 comments

Comments

@kit494way
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When receive multiple client/registerCapbility requests with same id, duplicate completion sources are registered like the issue coc-extensions/coc-omnisharp#53 .

Describe the solution you'd like
A clear and concise description of what you want to happen.

Call feature.unregister(registration.id) before this

feature.register(this._method2Message.get(registration.method)!, data)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@chemzqm
Copy link
Member

chemzqm commented Mar 22, 2021

Should be fixed by d9092b7

@chemzqm chemzqm closed this as completed Mar 22, 2021
@kit494way
Copy link
Author

It looks like the issue is not fixed.

When language server retry to send a client/registerCapability request, language client receive multiple requests with same registration id.
registerLanguageProvider() method is called whether the request with same id is already handled or not, although the registration is managed by the id.

let registration = this.registerLanguageProvider(data.registerOptions)
this._registrations.set(data.id, { disposable: registration[0], data, provider: registration[1] })

In the situation that requests with same id are received, it may be something wrong with language server, but it is helpful to unregister the provider before register with same id or drop the request.

@Nazeehe
Copy link

Nazeehe commented Mar 30, 2021

I am unclear as to if this issue is fixed or not. The issue is closed, but I am seeing from the post above that it might not be?

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

3 participants