fidget.nvim
fidget.nvim copied to clipboard
Known compatible LSP servers
This plugin is known to work with the following LSP servers:
- rust-analyzer (Rust)
- sumneko (Lua)
- null-ls (generic)
- gopls (Go [*issue])
- tsserver (Typescript, Javascript [*caveat])
- hls (Haskell)
- clangd (C, C++, Objective-C)
- pyright (Python)
- kotlin-language-server (Kotlin)
- dartls (Dart [*does not work with flutter-tools.nvim])
- erlangls (Erlang)
- solargraph (Ruby)
And doesn't (yet) work with the following:
Please comment below if you find this plugin works or doesn't work with an LSP server you use.
Note that fidget's implementation relies on my cursory and incomplete understanding of the progress notification spec. Please file a separate issue if you think there's something I missed.
However, if language servers actually deviate from spec, then this plugin will not know how to handle that. Please also file an issue in this repo for these cases.
Ideally we should never terminate ungracefully, and have some kind of sane behavior for handling these cases. For example, if a server never sends an end progress notification, then the fidget will remain stuck onscreen.
At the same time, if language servers do not appear to be conforming to LSP, we should file an issue with their maintainers, if anything but to clarify what the behavior is.
For tsserver
, I find this plugin works great with TypeScript, but not JavaScript. I tested it by opening a file in a JavaScript repo, but nothing was shown up.
hm, @yanzhang0219 I don't have that issue. It works the same for me in Javascript files.
@mrjones2014 could you please provide the js repo? I want to test it on my end. I cloned some js repos from github but not any progress information was shown on the bottom after I opened js files. Thanks.
I just tested it with a proprietary repo I had open at work. But testing a little further, it seems like there is an issue when there is only Javascript. It worked when I opened a Javascript file in a project which also contains Typescript files.
But I tested again with https://github.com/mrjones2014/eslint-plugin-storage and was able to reproduce the issue, actually.
Yes. That's what I was saying. Pure js repo has the issue. Let me test your repo now.
UPDATE: it is confirmed that it doesn't work with pure js repo.
I tested lsp-status.nvim
just now and it didn't show any progress for the pure js repo. So I think it completely depends on the server. If the server doesn't return progress information to Neovim core lsp client, this plugin can do nothing. Am I correct? @j-hui
If the server doesn't return progress information to Neovim core lsp client, this plugin can do nothing.
Yeah that's exactly right.
This is what I was thinking from the very beginning. I am not sure if there is need for specifying which servers it works with, it's up to the server to send messages and this plugin cannot do anything extra to ensure compatibility with specific servers. Isn't it correct?
Great plugin, having messages in status line never sat well with me. Your plugins employs such a simple yet beautiful idea, well done!
Thanks @gegoune !
I am not sure if there is need for specifying which servers it works with, it's up to the server to send messages and this plugin cannot do anything extra to ensure compatibility with specific servers. Isn't it correct?
Perhaps not, but a few people had asked about this information, so I figured it's worth accumulating this knowledge somewhere.
Also, while LSP defines the progress endpoint, ~it doesn't seem to say anything about the format with which servers should report progress. For example, right now I assume that each progress notification comes with a message
field and a title
field.~ I just read the document more closely and realized the format is indeed specified by the protocol. But I still want to keep this issue to help me keep track of different schemas different language servers may employ, in case my implementation misses anything in the spec, or in case any server deviates from spec.
Works with pyright
as well.
I am using this also with kotlin (https://github.com/fwcd/kotlin-language-server) and works properly. FYI the kotlin-language-server takes a lot to startup, so fidget starts around 30 seconds after opening the first file of the session
Solargraph (Ruby LSP) works. Server itself can take a few seconds to start sending messages, especially on larger projects.
Yes. That's what I was saying. Pure js repo has the issue. Let me test your repo now.
UPDATE: it is confirmed that it doesn't work with pure js repo.
You need either a tsconfig.json or a jsconfig.json file on your project for it to work.
dartls
with lspconfig works fine, but flutter-tools.nvim does not, is there some modification ? I'm not familiar with LSP specs
Works out of the box with erlang-ls for me, tested with version 0.23.1.
@fitrh flutter-tools.nvim appears to install their own progress handler, which will override Fidget's: https://github.com/akinsho/flutter-tools.nvim/blob/3f3b16d69cdd26e2ed1b2baa719abac7f4c1a8b1/lua/flutter-tools/lsp/init.lua#L85
@j-hui does this line mean they still call the default handler so other plugin can use it ? I tried using arkav/lualine-lsp-progress and it seems they can catch the progress from flutter-tools.nvim
@j-hui dartls
with flutter-tools.nvim
works, seems like a lazy loading issue
this plugin does not work with elixirls
at the moment. I'd be willing give the fix a try, but I am completely new to all of it
this plugin does not work with
elixirls
at the moment. I'd be willing give the fix a try, but I am completely new to all of it
It doesn't seem like elixir-ls implements workDoneProgress Without it, there's no data for fidget to report.
You can monitor LSP exchange by setting vim.lsp.set_log_level("debug")
and tailing ~/.cache/nvim/lsp.log
. Sumneko or Solargraph will initiate startup progress report with something akin to:
[DEBUG][2022-03-23 18:46:56] .../vim/lsp/rpc.lua:454 "rpc.receive" { id = 9, jsonrpc = "2.0", method = "window/workDoneProgress/create", params = { token = 2 }}
[DEBUG][2022-03-23 18:46:56] .../vim/lsp/rpc.lua:454 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = 2, value = { cancellable = false, kind = "begin", message = "46/511", percentage = 9, title = "Loading workspace" } }}
[DEBUG][2022-03-23 18:46:56] .../vim/lsp/rpc.lua:454 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = 2, value = { kind = "report", message = "48/511", percentage = 9 } }}
[DEBUG][2022-03-23 18:46:57] .../vim/lsp/rpc.lua:454 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = 2, value = { kind = "report", message = "53/511", percentage = 10 } }}
ElixirLs doesn't initiate this reporting and I can't find any mention of workDone
in its or it dependencies code.
I've tried adding basic scala metals support:
local function metals_status_handler(_, status, ctx)
-- https://github.com/scalameta/nvim-metals/blob/main/lua/metals/status.lua#L36-L50
local val = {}
if status.hide then
val = {kind = "end"}
elseif status.show then
val = {kind = "begin", message = status.text}
elseif status.text then
val = {kind = "report", message = status.text}
else
return
end
local info = {client_id = ctx.client_id}
local msg = {token = "metals", value = val}
-- call fidget progress handler
vim.lsp.handlers["$/progress"](nil, msg, info)
end
local handlers = {}
handlers['metals/status'] = metals_status_handler
require('lspconfig')['metals'].setup {
init_options = {
-- default setting in lspconfig is "show-message"
statusBarProvider = "on"
},
handlers = handlers
}
Currently it will show 'nil' in the fidget output, not sure what is the cause (did not look into much of the code) Also, there is a spinner icon in the metals status text, perhaps we can trim that out.
Looks like omnisharp doesn't work at the moment, I'd be keen to give it a try though.
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
It doesn't seem to work with jedi-language-server
for python.
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 theinit_options
It works in Cmake project. If you have makefile project, then shift to "Cmake project"
It works in Cmake project. If you have makefile project, then shift to "Cmake project"
No, with this config even makefile project works for me, I think all we need is init_options.clangdFileStatus = true
@jsholmes @asteroidalaz @fitrh it definitely works with Clangd, regardless of build system (make vs clangd). I use fidget with clangd daily.
What matters is you need to have your build system generate a compile_commands.json to tell clangd what what flags you're compiling each file with. Iirc cmake happens to know how to generate these out of the box; for Makefiles, you'll need the help of a tool like bear.
If you are still having trouble with clangd (or any other language server), first verify that you are able to get other LSP features working (e.g., see if go to definition works). If it still doesn't work, open an issue. This issue is not for troubleshooting specific LSP setups; it is for discussing whether language servers provide progress notifications given that they already work otherwise.
(Conversation moved to #90)
@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?
~~Unfortunately I can't get fidget to work with Julia, even though LanguageServer.jl sends workDoneProress according to some issues over there.~~
Julia works. It takes a while to show up but that is LS.jl's fault, it is notoriously slow at initializing. Thanks for this rad plugin!
This works with phpactor (PHP).