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

Known compatible LSP servers

Open j-hui opened this issue 2 years ago • 28 comments

This plugin is known to work with the following LSP servers:

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.

j-hui avatar Jan 27 '22 18:01 j-hui

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.

rockyzhang24 avatar Jan 27 '22 19:01 rockyzhang24

hm, @yanzhang0219 I don't have that issue. It works the same for me in Javascript files.

mrjones2014 avatar Jan 27 '22 19:01 mrjones2014

@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.

rockyzhang24 avatar Jan 27 '22 19:01 rockyzhang24

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.

mrjones2014 avatar Jan 27 '22 19:01 mrjones2014

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.

rockyzhang24 avatar Jan 27 '22 19:01 rockyzhang24

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

rockyzhang24 avatar Jan 27 '22 20:01 rockyzhang24

If the server doesn't return progress information to Neovim core lsp client, this plugin can do nothing.

Yeah that's exactly right.

j-hui avatar Jan 27 '22 21:01 j-hui

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!

gegoune avatar Jan 27 '22 22:01 gegoune

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.

j-hui avatar Jan 27 '22 22:01 j-hui

Works with pyright as well.

polyzen avatar Jan 27 '22 22:01 polyzen

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

crisidev avatar Jan 28 '22 14:01 crisidev

Solargraph (Ruby LSP) works. Server itself can take a few seconds to start sending messages, especially on larger projects.

Slotos avatar Feb 06 '22 19:02 Slotos

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.

cjnucette avatar Feb 12 '22 11:02 cjnucette

dartls with lspconfig works fine, but flutter-tools.nvim does not, is there some modification ? I'm not familiar with LSP specs

fitrh avatar Feb 15 '22 12:02 fitrh

Works out of the box with erlang-ls for me, tested with version 0.23.1. Screenshot_20220219_142025

HiPhish avatar Feb 19 '22 13:02 HiPhish

@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 avatar Feb 19 '22 16:02 j-hui

@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

fitrh avatar Feb 20 '22 14:02 fitrh

@j-hui dartls with flutter-tools.nvim works, seems like a lazy loading issue

fitrh avatar Feb 20 '22 14:02 fitrh

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

mrnovalles avatar Mar 23 '22 11:03 mrnovalles

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.

Slotos avatar Mar 23 '22 16:03 Slotos

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.

image

pca006132 avatar Mar 30 '22 16:03 pca006132

Looks like omnisharp doesn't work at the moment, I'd be keen to give it a try though.

benjstephenson avatar Jul 03 '22 23:07 benjstephenson

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

jsholmes avatar Jul 15 '22 20:07 jsholmes

It doesn't seem to work with jedi-language-server for python.

zefr0x avatar Aug 02 '22 16:08 zefr0x

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 works in Cmake project. If you have makefile project, then shift to "Cmake project"

Alaz-Oz avatar Aug 07 '22 06:08 Alaz-Oz

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

fitrh avatar Aug 07 '22 06:08 fitrh

@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 avatar Aug 07 '22 13:08 j-hui

@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?

jsholmes avatar Sep 08 '22 19:09 jsholmes

~~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!

kataklasm avatar Jan 04 '23 22:01 kataklasm

This works with phpactor (PHP).

calebdw avatar Feb 10 '23 14:02 calebdw