j-hui / fidget.nvim

💫 Extensible UI for Neovim notifications and LSP progress messages.
MIT License
1.95k stars 58 forks source link

Cannot ignore null-ls #232

Closed sinkr closed 2 months ago

sinkr commented 5 months ago

I know this has been discussed alot here before, but none of those code snippets/methodologies work. Following what I think is outlined here to go into opts, I have tried every combination that null/none-ls could be called as to no avail.

Full Lazy plugin config from .nvim/lua/plugins

return {
  "j-hui/fidget.nvim",
  opts = {
    {
      progress = {
        ignore = { "null-ls", "null_ls", "none-ls", "none_ls" },
      },
    },
  },
}

I also have tried this config sans one extra set of braces:

return {
  "j-hui/fidget.nvim",
  opts = {
    progress = {
      ignore = { "null-ls", "null_ls", "none-ls", "none_ls" },
    },
  },
}

I have also tried calling setup() in both config and init functions explicitly to no avail:

return {
  "j-hui/fidget.nvim",
  config = function()
    require("fidget").setup()
  end,
  opts = {
    progress = {
      ignore = { "null-ls", "null_ls", "none-ls", "none_ls" },
    },
  },
}
j-hui commented 5 months ago

I'm not exactly sure how the Lazyvim distribution's plugin configuration system works, but assuming it is the same as the lazy.nvim plugin spec, the first and third code snippet are wrong. In the first, you are nesting the options table one level deeper than you should be, while in the third, you are specifying an options table but not using it in your config function. The second one looks right to me at a glance.

Now, I'm not sure what null-ls uses as its client name, but that should be caught here: https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/lua/fidget/progress.lua#L217-L225

I recommend turning on INFO-level logging and looking at the log file to see what the lsp_client.name of those unwanted notifications is, logged here: https://github.com/j-hui/fidget.nvim/blob/1ba38e4cbb24683973e00c2e36f53ae64da38ef5/lua/fidget/progress.lua#L227

j-hui commented 3 months ago

@sinkr have you been able to resolve this issue?

sinkr commented 3 months ago

No. I never could get it to work with Noice (i.e. LazyVim), so I just disabled and moved on.

j-hui commented 2 months ago

I finally got around to setting up none-ls myself and checking. Just ignore = { "null-ls" } should be sufficient (that is the name of the LSP server, which ignore uses).

I also pushed a01443a which allows you to specify a per-message filter, in case you need anything more complicated.

I'm closing this issue now since it doesn't seem like there is much more to be done. Feel to re-open if you feel there's anything I didn't address!