LemMinX illegally invokes `client/unregisterCapability` with empty arguments upon startup
Recently noticed following error messages in Sublime Text's console, when opening XML documents.
Error handling request
Traceback (most recent call last):
File "Packages\LSP\plugin\core\sessions.py", line 2273, in on_payload
handler(result, req_id)
File "Packages\LSP\plugin\core\sessions.py", line 1983, in m_client_unregisterCapability
unregistrations = params["unregisterations"] # typo in the official specification
KeyError: 'unregisterations'
The reason is client/unregisterCapability method being invoked without required unregisterations argument being passed, which is a protocol violation.
:: [14:29:44.642] <-- LemMinX client/unregisterCapability (16): {}
:: [14:29:44.642] ~~> LemMinX (16) (duration: 0ms): {'code': -32603, 'message': "'unregisterations'"}
related with: https://github.com/sublimelsp/LSP/issues/2331
Any contribution are welcome!
A pre-condition for this issue to trigger is to set "xml.symbols.enabled": false.
Looks like that's causing the capability to be unregistered right after being registered.
:: [16:29:56.840] <-- LemMinX client/registerCapability (15): {'registrations': [{'id': '1e186383-1ca3-4a0a-97a9-e0405291910a', 'method': 'textDocument/documentSymbol'}]}
:: [16:29:56.840] >>> LemMinX (15) (duration: 0ms): None
:: [16:29:56.840] <-- LemMinX client/unregisterCapability (16): {}
:: [16:29:56.840] ~~> LemMinX (16) (duration: 0ms): {'code': -32603, 'message': "'unregisterations'"}
That's suspicious though as I'd interpret the following lines as the capability being registered/unregistered on demand, based on value of xml.symbols.enabled.
https://github.com/eclipse/lemminx/blob/d1d67ec09ad8ded638fc7c8ce1f52b72b33b8ec9/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/settings/capabilities/XMLCapabilityManager.java#L238-L241