fidget.nvim icon indicating copy to clipboard operation
fidget.nvim copied to clipboard

Progress from the LSP like lua-ls stays even it's 100%.

Open thenullvek opened this issue 1 year ago • 4 comments

Bildschirmfoto 2024-04-04 um 03 12 05

Setup: NvChad v2.5

Logs:

[INFO  Do  4 Apr 03:08:56 2024] /lua/fidget.lua:48: fidget.nvim setup() complete.
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.205s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  cancellable = false,
  message = "69/138",
  percentage = 49,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 1 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  69/138
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:90: Poller ( notification ) starting at 7.206s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.207s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  cancellable = false,
  message = "69/124",
  percentage = 54,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  69/124
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.268s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "88/138",
  percentage = 63,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  88/138
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.268s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "88/124",
  percentage = 70,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  88/124
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.318s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "116/138",
  percentage = 83,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  116/138
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.319s
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "116/124",
  percentage = 92,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:03 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  116/124
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.442s
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "124/124",
  percentage = 100,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:221: Processed 2 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  124/124
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.443s
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:211: Got message from 1 (lua_ls) : {
  message = "138/138",
  percentage = 100,
  title = "Loading workspace"
}
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:221: Processed 1 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress.lua:227: Notifying LSP progress message from lua_ls : Loading workspace  |  138/138
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.444s
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:221: Processed 1 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress.lua:210: No LSP messages (that can be displayed)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/poll.lua:134: Poller ( progress ) polling once at 7.454s
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:194: Polling messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress/lsp.lua:221: Processed -0 messages from 1 (lua_ls)
[INFO  Do  4 Apr 03:09:04 2024] /lua/fidget/progress.lua:210: No LSP messages (that can be displayed)

thenullvek avatar Apr 04 '24 01:04 thenullvek

Sounds related to #201. Have you tried setting the progress.lsp.progress_ringbuf_size setting to something large, like 2048? That might fix it for you.

j-hui avatar Apr 04 '24 15:04 j-hui

Hey i've got the same problem, I've tried the #201 fix, even with 10000 and it still stays (in my case it's rust-analyzer)

NicolasGB avatar Apr 22 '24 09:04 NicolasGB

I try using autocmd to remove the notification, and it seems working fine so far:

vim.api.nvim_create_autocmd("LspProgress", {
  pattern = "end",
  callback = function(ev)
    local token = ev.data.result.token
    local client_id = ev.data.client_id
    local client = client_id and vim.lsp.get_client_by_id(client_id)
    if client and token then
      require("fidget").notification.remove(client.name, token)
    end
  end,
})

cairijun avatar May 04 '24 12:05 cairijun

@cairijun thanks for this! I had to modify it slightly -- the token was in params not result (neovim: 0.10.0)

vim.api.nvim_create_autocmd("LspProgress", {
    pattern = "end",
    callback = function(ev)
        local token = ev.data.params.token
        local client_id = ev.data.client_id
        local client = client_id and vim.lsp.get_client_by_id(client_id)
        if client and token then
            require("fidget").notification.remove(client.name, token)
        end
    end,
})

collinvandyck avatar Jun 14 '24 13:06 collinvandyck