fidget.nvim
fidget.nvim copied to clipboard
:lua require"fidget".setup{} not working with clangd
This says it works with clangd, but it doesn't seem to for me. Is there something extra I need to add to the clangd config? I'm already doing clangdFileStatus = true
in the init_options
Originally posted by @jsholmes in https://github.com/j-hui/fidget.nvim/issues/17#issuecomment-1185887581
I debuged further according to the docs and found that :lua require"fidget".setup{}
does not work in a buffer served by clangd. It prints no error or anything, though.
LUA buffers are working fine, btw and showing the fidget info.
Can you confirm that clangd is working in general? I.e., it can perform other LSP functions like providing hover or goto definition
Also, can you give a minimal project to reproduce your issue?
Yeah clangd is working fine in general and it was working with lsp-status.
I'll try to put together a minimal config to reproduce the issue soon.
I did find out that even though it appears to be working fine in lua (see screenshot below), when I try lua print(require"fidget".is_installed())
it still prints false, so that seems odd:

Really it happens with only my lsp config and fidget.nvim. So I'm wondering, what version of clangd have you tried this with? I'm using version 13.0.0.
maybe it is fast on loading for clangd @jsholmes
From #17
@j-hui , clangd works well for me in all other LSP-related activities. goto definition, code completion via cmp, lsp-saga works, etc. It is only fidget that dosen't seem to work with clangd.
Note, i do not have compile_commands,json. Instead, I use compile_flags.txt. (see https://releases.llvm.org/8.0.0/tools/clang/tools/extra/docs/clangd/Installation.html). Perhaps this is the issue?
That may be the issue, though I'm not sure why; I use compile_commands.json
and haven't had any problems myself.
I`m reporting from a user perspective that fidget is not open-box working with clangd from mason for example if I do nvim hello.c
, not like other servers such as lua-language-server; gopls; rust-analyzer and Im still confused what I need to do to fire it up after I check the doc.
I did find out that even though it appears to be working fine in lua (see screenshot below), when I try
lua print(require"fidget".is_installed())
it still prints false, so that seems odd:
I think this is because now nvim has a built in handler for progress, and fidgets wraps it so that it runs that before its own handler, and the is_installed()
method returns false
because it only returns true
when the handler is only its own handler, not the builtin plus its own
https://github.com/neovim/neovim/blob/8e52d8a394799ede43ae5e80574f12dede9bc13e/runtime/lua/vim/lsp/handlers.lua#L24 https://github.com/j-hui/fidget.nvim/blob/688b4fec4517650e29c3e63cfbb6e498b3112ba1/lua/fidget.lua#L532-L540 https://github.com/j-hui/fidget.nvim/blob/688b4fec4517650e29c3e63cfbb6e498b3112ba1/lua/fidget.lua#L484-L486
So the method is not reliable anymore to check whether the handler is installed: for now I'm in your same situation where I've only seen it working in lua (tried clang, rust-analyzer and pyright), but not sure why it's the case
Just stopping by to comment that this doesn't seem to be working for me as well. The Lsp Functionally is working though
In my case the issue could be solved by reviewing my lspconfig setup. With the intent of customizing some of the LSP server setting, I ran the setup()
method on the clients again, but this time without providing the capabilities that are necessary for things like fidget to work correctly. After sorting out my config taking kickstart.nvim as inspiration, fidget is working absolutely fine with servers installed by Mason.
The file status extension in clangd does NOT use the progress protocol, so it definitely won't work with fidget.nvim.
What you guys see it "working" is the progress report from clangd's background indexer, which has nothing to do with the file status extension, and I think it does require a compile_command.json
.
Seems to not be Fidget's issue, then. Thanks @cairijun