Lsp-mode: Add support for Progress Notifications

Created on 16 Feb 2020  路  8Comments  路  Source: emacs-lsp/lsp-mode

Are there any plans to add support for $/progress notifications, as introduced by version 3.15 of the protocol?

3.15 enhancement

All 8 comments

Yes, we havent started working on 3.15 spec. I am looking for servers implementing the new features to test with.

Chicken and egg situation :)

I know haskell and erlang are aiming to do it.

I recently saw haskell-ide-engine printing this:

2020-03-03 10:57:33.045762232 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.5135135135135135,"message":"Brig.User.Email"},"token":0},"method":"$/progress"}
2020-03-03 10:57:33.345779649 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.527027027027027,"message":"Brig.Team.Email"},"token":0},"method":"$/progress"}
2020-03-03 10:57:33.505780055 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.5405405405405406,"message":"Brig.Provider.Email"},"token":0},"method":"$/progress"}
2020-03-03 10:57:33.725778867 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.5540540540540541,"message":"Brig.Provider.DB"},"token":0},"method":"$/progress"}
2020-03-03 10:57:34.606894333 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.5675675675675675,"message":"Brig.Provider.RPC"},"token":0},"method":"$/progress"}
2020-03-03 10:57:34.945778943 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.581081081081081,"message":"Brig.Code"},"token":0},"method":"$/progress"}
2020-03-03 10:57:35.305778848 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.5945945945945946,"message":"Brig.Data.User"},"token":0},"method":"$/progress"}
2020-03-03 10:57:35.946149976 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6081081081081081,"message":"Brig.User.Handle"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.040479247 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6216216216216216,"message":"Brig.Data.UserKey"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.265778351 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6351351351351351,"message":"Brig.Data.Blacklist"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.366075272 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6486486486486487,"message":"Brig.Data.Properties"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.465801361 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6621621621621622,"message":"Brig.Data.PasswordReset"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.605775161 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6756756756756757,"message":"Brig.Data.LoginCode"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.72582168 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.6891891891891891,"message":"Brig.Data.Connection"},"token":0},"method":"$/progress"}
2020-03-03 10:57:36.945793464 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7027027027027027,"message":"Brig.Data.Client"},"token":0},"method":"$/progress"}
2020-03-03 10:57:37.386086783 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7162162162162162,"message":"Brig.Data.Activation"},"token":0},"method":"$/progress"}
2020-03-03 10:57:37.665756129 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7297297297297297,"message":"Brig.API.Types"},"token":0},"method":"$/progress"}
2020-03-03 10:57:37.825919287 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7432432432432432,"message":"Brig.IO.Intra"},"token":0},"method":"$/progress"}
2020-03-03 10:57:38.844938005 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7567567567567568,"message":"Brig.API.Error"},"token":0},"method":"$/progress"}
2020-03-03 10:57:39.285932411 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7702702702702703,"message":"Brig.Team.Util"},"token":0},"method":"$/progress"}
2020-03-03 10:57:39.439566534 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7837837837837838,"message":"Brig.AWS.SesNotification"},"token":0},"method":"$/progress"}
2020-03-03 10:57:39.515766579 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.7972972972972973,"message":"Brig.API.User"},"token":0},"method":"$/progress"}
2020-03-03 10:57:41.31609055 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.8108108108108109,"message":"Brig.User.Auth"},"token":0},"method":"$/progress"}
2020-03-03 10:57:41.695777993 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.8243243243243243,"message":"Brig.API.Properties"},"token":0},"method":"$/progress"}
2020-03-03 10:57:41.756335033 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.8378378378378378,"message":"Brig.API.Handler"},"token":0},"method":"$/progress"}
2020-03-03 10:57:41.875899435 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.8513513513513513,"message":"Brig.User.API.Search"},"token":0},"method":"$/progress"}
^[[A2020-03-03 10:57:42.075995218 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"report","percentage":0.8648648648648649,"message":"Brig.User.API.Auth"},"token":0},"method":"$/progress"}

So, I guess it already supports it.

gopls@latest just got $/progress support, but so far only used for one particular code lense.

Background jobs with support for progress reports are being added to the Erlang Language Server, too:

https://github.com/erlang-ls/erlang_ls/pull/594

Things which are not yet implemented: cancellation and PartialResultProgress.

Background jobs have a nice API that you can trigger by attaching to the Language Server shell and executing something like:

  Config = #{ task => fun (_) -> timer:sleep(1000) end
            , entries => lists:seq(1, 60)
            , title => <<"Sleep 1 second 60 times">>
            },
  els_background_job:new(Config).

This should turn out useful if you want to experiment with the client UI. More information on how to attach to the server shell:

https://erlang-ls.github.io/troubleshooting/

This is great news, thanks!!!

Tried with Erlang LS, nice. Would it make sense to use the spinner for this?

I went with the progress-reporter as a standard mechanism, that is already being used in lsp-mode. My assumption was that it could be customised to use other presentation layer reporting?

Was this page helpful?
0 / 5 - 0 ratings