hardhat-vscode icon indicating copy to clipboard operation
hardhat-vscode copied to clipboard

Use of registerCapability with dynamicRegistration set to false

Open frangio opened this issue 2 years ago • 4 comments

(This is my last issue for today!)

I don't know what this means but I see this in the Neovim logs when using the server directly with the built-in LSP client:

The language server solidity triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless

frangio avatar Jan 03 '23 20:01 frangio

My guess is: the language server returns a set of capabilities, these are either immediately available at boot or dynamically registerable (they will become available at some point). I suspect we don't have the metadata of one of our capabilities quite right, vscode has always given us a pass but neovim is being a stickler.

kanej avatar Jan 04 '23 09:01 kanej

Just dug into this a bit. The registerCapability request that the server is sending is for the workspace/didChangeWorkspaceFolders capability. Before sending this, we check that the client supports it, according to the protocol. In this part it specifies that the server is allowed to register that capability if initializationParams.capabilities.workspace.workspaceFolders is true, and this is the case for neovim's client initialization. So I may be wrong but it looks like the problem is on nvim's language client, and the warning should not be shown.

antico5 avatar Jan 18 '23 16:01 antico5

Thanks for looking into this. I'm not familiar with the LSP spec so I can't really comment. This does seem harmless so feel free to close it.

frangio avatar Jan 18 '23 18:01 frangio

Lets open an issue against the nvim language server client and see what they think, @antico5.

kanej avatar Jan 19 '23 09:01 kanej