WhoIsSethDaniel / lualine-lsp-progress.nvim

LSP progress lualine component
MIT License
62 stars 3 forks source link

Disable In Progress/Commenced message #6

Closed petobens closed 1 year ago

petobens commented 1 year ago

@rorystephenson @WhoIsSethDaniel after https://github.com/WhoIsSethDaniel/lualine-lsp-progress.nvim/pull/4 I'm always seeing the In Progress/commenced message. I want lualine only to display when the lsp is loading. I tried removing the commenced bit from the following config but without success:

            {
                'lsp_progress',
                component_separator = { left = '', right = '' },
                message = {
                    initializing = 'Start…',
                    commenced = '*',
                    completed = 'Done!',
                },
                display_components = {
                    'lsp_client_name',
                    { 'message' },
                },

Any pointers are greatly appreciated.

Also is there a way to disable showing null-ls? Thanks in advance for the help!

rorystephenson commented 1 year ago

Hmm it must be a difference in how the lsp clients work, it works fine for me in dart, sorry about that! What lsp client are you using so I can try to reproduce the issue?

petobens commented 1 year ago

No problem! I'm using pyright in python (and also null-ls plugin).

WhoIsSethDaniel commented 1 year ago

I don't have the dart lsp server to work with but my assumption would be that the dart lsp server isn't sending back a 'done' message. Or somehow the messages are out of order. @rorystephenson do you have an example of a typical set of messages from the dart lsp server?

strdr4605 commented 1 year ago

I also have this issue when the server will stay In Progress forever

 [null-ls] 🌒  Initializing…: (In Progress) [copilot] 🌒  Initializing…: (In Progress)       

:LspInfo

 3 client(s) attached to this buffer: 

 Client: null-ls (id: 1, bufnr: [1])
    filetypes:       sh, css, vue, handlebars, typescriptreact, less, yaml, graphql, jsonc, json, typescript, markdown, html, scss, markdown.mdx, javascript, javascriptreact, lua, luau
    autostart:       false
    root directory:  /Users/strdr4605/.dotfiles
    cmd:             <function>

 Client: sumneko_lua (id: 2, bufnr: [1])
    filetypes:       lua
    autostart:       true
    root directory:  /Users/strdr4605/.dotfiles/nvim
    cmd:             lua-language-server

 Client: copilot (id: 3, bufnr: [1])
    filetypes:       
    autostart:       false
    root directory:  /Users/strdr4605/.dotfiles
    cmd:             node /Users/strdr4605/.local/share/nvim/site/pack/packer/opt/copilot.lua/copilot/index.js
WhoIsSethDaniel commented 1 year ago

@strdr4605 is this all servers or just some servers? Which servers? (do all the servers in your post above exhibit this, or just some?)

strdr4605 commented 1 year ago

It looks like; I am not advanced in this. How can I test that it affects all servers

https://user-images.githubusercontent.com/16056918/215880167-b37867f0-836f-4ad0-aed2-ad4adf5b9285.mov

WhoIsSethDaniel commented 1 year ago

@strdr4605 sorry I was unclear. I mean do all servers that you use exhibit this issue? Your video seems to say "yes, all servers I use exhibit this issue."

rlees85 commented 1 year ago

I am having this issue on all language servers (terraform/powershell/bicep/yaml/bash/dockerfile/etc...)... thanks for the plugin by the way!

WhoIsSethDaniel commented 1 year ago

I am able to replicate this. I will have a look.

WhoIsSethDaniel commented 1 year ago

If I comment out the autocmd for LspAttach this problem goes away. Still trying to see why.

WhoIsSethDaniel commented 1 year ago

I believe the issue is resolved in the most recent master. Please LMK.

petobens commented 1 year ago

Hi @WhoIsSethDaniel ! I think that this is mostly fixed however for pyright (python lsp) I'm always seeing the commenced icon/message.. Can that be fixed?

image

WhoIsSethDaniel commented 1 year ago

@petobens It's hard to say. I'm not familiar with pyright (or python) so it may be difficult to test. I don't see this issue and have had no luck replicating it. I may need some assistance from you to help resolve the issue.

WhoIsSethDaniel commented 1 year ago

It seems the reason is that pyright doesn't send status messages. The PR that triggered this (#4) doesn't account for this scenario and simply stuffs an "Initializing" message into the message queue. I may have to make the changes in #4 (as well as changes I made in #7) optional and based on server name. I don't entirely understand the problem #4 was trying to solve and I am assuming that it solves some problem in at least a small number of LSP servers.

petobens commented 1 year ago

Great that you managed to track it down! Thanks

WhoIsSethDaniel commented 1 year ago

I've re-read #4 and it simply allows for a status update more quickly than what was being observed. This seems useful for LSP servers that take a long time to send their first status message. I'll need to think about how to deal with this in config.

WhoIsSethDaniel commented 1 year ago

The plugin may also be able to retrieve server capabilities and see if the server claims to send status messages. That may be the best solution assuming it is reliable.

WhoIsSethDaniel commented 1 year ago

It doesn't look like the sever capabilities announce that status messages will be forthcoming. If anyone knows any different please let me know.

WhoIsSethDaniel commented 1 year ago

@petobens you can now hide a server from ever showing status. e.g.

{ `lsp_progress', hide = { 'pyright' } }
petobens commented 1 year ago

Thank! I believe this issue is now resolved. Feel free to close