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

Weird hover diagnostic buffer behavior #609

Closed
DrPyser opened this issue Apr 6, 2022 · 7 comments
Closed

Weird hover diagnostic buffer behavior #609

DrPyser opened this issue Apr 6, 2022 · 7 comments

Comments

@DrPyser
Copy link

DrPyser commented Apr 6, 2022

Hi! Thanks for this great tool!

I'm using latest version(12.1.0-snapshot).

I'm seeing flaky behavior with hover fifo buffers, working on python code(pyls).

Diagnostics/doc info often don't manage to stay in the buffer, they just blink in and out and the buffer ends up empty. After investigations, it seems that kak-lsp is repeating requests to the language server multiple times. That is, moving the cursor to a position once triggers a number of identical requests to the lsp server, and on each response kak-lsp reopens the buffer on the fifo, clearing it.

Log excerps

Apr 06 18:29:46.914 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":771}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:46.921 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":772}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:46.930 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":773}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:46.935 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":774}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:46.938 DEBG From server: {"jsonrpc":"2.0","id":771,"result":...}
Apr 06 18:29:46.948 DEBG From server: {"jsonrpc":"2.0","id":772,"result":...}
Apr 06 18:29:46.963 DEBG From server: {"jsonrpc":"2.0","id":773,"result":...}
Apr 06 18:29:47.027 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":775}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:47.031 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":776}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:47.034 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":777}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:47.039 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":9,"line":37},"textDocument":{"uri":"file:///home/charles-langlois/repositories/microadobe/microadobe/microadobe/app.py"}},"id":778}, module: kak_lsp::language_server_transport:177
Apr 06 18:29:47.063 DEBG From server: {"jsonrpc":"2.0","id":774,"result":...}
Apr 06 18:29:47.079 DEBG From server: {"jsonrpc":"2.0","id":776,"result":...}
Apr 06 18:29:47.091 DEBG From server: {"jsonrpc":"2.0","id":777,"result":...}

Thanks for any support!

@krobelus
Copy link
Member

krobelus commented Apr 6, 2022

pyls

I recommend switching to the more actively maintained pylsp AKA python-lsp-server which is in the default config.

I don't know how to reproduce. Based on your description I'm guess you are using something like lsp-auto-hover-enable client1 (while navigating in client0) which works just fine.

After investigations, it seems that kak-lsp is repeating requests to the language server multiple times. That is, moving the cursor to a position once triggers a number of identical requests to the lsp server, and on each response kak-lsp reopens the buffer on the fifo, clearing it.

Good observation. I get redundant requests if I run lsp-auto-hover-enable multiple times but they're not destructive - because they each gets the same response - is that not the case for you?

@DrPyser
Copy link
Author

DrPyser commented Apr 7, 2022

I meant pylsp, sorry.

In my case the buffer ends up empty most of the time.

@DrPyser
Copy link
Author

DrPyser commented May 6, 2022

What would explain the behavior of repeated requests? Why isn't a single request sent to the LSP server?

@DrPyser
Copy link
Author

DrPyser commented May 6, 2022

Hmm, interestingly, fixed the flakiness by invoking lsp-hover-buffer docs. Now the hover info remains stable in the hover buffer.

@krobelus
Copy link
Member

krobelus commented May 6, 2022

What would explain the behavior of repeated requests?

I get redundant requests if I run lsp-auto-hover-enable multiple times
Make sure your config only calls it once

@sclu1034
Copy link
Contributor

Presumably the same behaviour as #664.

@krobelus
Copy link
Member

yep, this should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants