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

Pyright Attempts Triggering registerCapability handler despite dynamicRegistration set to false #2690

Closed
holmanb opened this issue Dec 10, 2021 · 4 comments · Fixed by #4666
Labels
as designed Not a bug, working as intended

Comments

@holmanb
Copy link

holmanb commented Dec 10, 2021

Describe the bug
Pyright attempts dynamic registration despite the the fact that the client does not support it.

To Reproduce
A minimal pyright configuration with neovim will reproduce. Requires (nvim > 0.5). Enable logging and check the logs.

Expected behavior
I expected to not see this warning.

Screenshots or Code

  4 [DEBUG][2021-12-09 21:30:06] .../vim/lsp/rpc.lua:496    "rpc.receive"   {  id = 0,  jsonrpc = "2.0",  method = "client/registerCapability",  params = {    registrations = { {        id = "b984e4cb-c66    3-453c-a46e-7eda50013708",        method = "workspace/didChangeWorkspaceFolders",        registerOptions = vim.empty_dict()      } }  }}
  3 [WARN][2021-12-09 21:30:06] ...lsp/handlers.lua:108     "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is ha    rmless"

VS Code extension or command-line
Neither. Neovim 0.5.1 using native lsp.

Additional context

Here is a minimal log containing all of the JSON RPC related to this issue. I am also using esm with flake8 as an LSP server, so there are traces of that in the log. Note dynamicRegistration = false on line 2.

@erictraut
Copy link
Collaborator

I think pyright is doing the right thing here. It's registering for the "workspaceFolders" capability. Unlike most capabilities, this one doesn't have a "dynamicRegistration" indication. It's simply a boolean field indicating whether "workspaceFolders" is supported. NeoVim is indicating that it supports this capability ("workspaceFolders = true"). So I think the error message in the attached log is incorrect.

@erictraut erictraut added the as designed Not a bug, working as intended label Dec 10, 2021
@holmanb
Copy link
Author

holmanb commented Dec 10, 2021

@erictraut Thanks for the response! It sounds like there is nothing to do here, so I will close this issue.

@holmanb holmanb closed this as completed Dec 10, 2021
@nschloe
Copy link

nschloe commented Apr 6, 2022

I'm debugging a similar issue and also found this error message. @holmanb Did you report this anywhere else?
In the message

[WARN][2022-04-06 09:38:58] ...lsp/handlers.lua:109     "The language server pyright triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"

I don't even know what "upstream" is.

@holmanb
Copy link
Author

holmanb commented Apr 8, 2022

@holmanb Did you report this anywhere else?

I don't recall. I doubt it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as designed Not a bug, working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants