Closed petobens closed 1 year ago
Do you mean "how do I only show the progress of attached clients to the buffer I am currently viewing?" You can't do this with the current code. I'll consider an option that allows for this.
ow do I only show the progress of attached clients to the buffer I am currently viewing
Yep exactly that. I'm viewing a lua file (as in the video) then I don't wan't to see a "pyright" server indicator since it is attached but no active for lua.
I've added a new option that should allow a user to only see the status for LSP servers attached to the currently active buffer. e.g.
{ 'lsp_progress', only_show_attached = true }
By default this option is false.
It seems to work for me, but I don't typically have a variety of LSP servers running at once in different buffers. It's not a use case I have yet to experience myself.
Mmm it doesn't quite seem to work? If, as in the GIF, I do:
I expect to see pyright in the python file and sumneko in the lua file but not both.
For what its worth :LspInfo
somehow does know which client is attached to which buffer and whether it is active or not:
Unfortunately pyright
is a bad example since it doesn't send status messages. It should be hidden in your configuration:
{ 'lsp_progress', hide = { 'pyright' } }
Since pyright
sends no status messages it will never be removed from the list of servers to show. The code can be changed slightly to get rid of this defect, but pyright
will continue to be shown when viewing your python file.
I test using a go
file and a lua
file and I switch between the buffers and the status changes as expected. When viewing the go
file I see gopls
status. When viewing the lua
file I see lua-language-server
status. For both I see null-ls
status.
I will update the code to deal with servers that don't send status messages, but the real fix for that is to hide such servers.
Thanks for the explanation! Feel free to close.
Hi! If I open a python and a lua file then (as it can be seen in the image) I see the pyright lsp shown while on the lua buffer. However if I run
LspInfo
I see that thepyright
client is active but not attached to the buffer. How can we show only the attached clients? (i.e pyright in the python file; sumneko_lua and null in the lua file)