elixir-lsp / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
https://elixir-lsp.github.io/elixir-ls/
Apache License 2.0
1.46k stars 193 forks source link

Feature request: Progress Support #848

Open wesleimp opened 1 year ago

wesleimp commented 1 year ago

Environment

Expected behavior

Report any kind of progress including work done progress

Reference: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress

lukaszsamson commented 1 year ago

Do you have an idea what needs progress reports?

wesleimp commented 1 year ago

@lukaszsamson a better integration with the IDE's. A visual feedback when the language server is ready to use, for example.

For neovim, there's this plugin that illustrate the case -> https://github.com/j-hui/fidget.nvim

lukaszsamson commented 1 year ago

It's too vague to action. We can think of adding it on per action basis. The problem is most of the actions that do take time (building, downloading deps, dializing) depend on upstream elixir and OTP APIs that do not report progress

wesleimp commented 1 year ago

Huum, ok. Is there a way to report only the work done progress? For example, when it starts and when it’s done? https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress

When the project is pretty large, the lsp take some time to index all the things, and when I try to navigate through the code, or use the hover callback, it returns an error telling me the action is not available

J3RN commented 1 year ago

IMO, the thing that most needs progress reports is startup. For some larger projects, especially when the server is pulling dependencies, startup can take >1 minute. As of right now, my editor doesn't have any sort of indicator of how startup is progressing or when the server is ready.

lukaszsamson commented 1 year ago

It’s not possible to send progress events until the client and server exchange initialized events. The first thing that can notify progress is project build or dialyzer plt build

Edit: It's actually possible to send progress notification during initialize if the client sets up a progress token in the initialize params

miguno commented 3 months ago

+1

Would it be possible to at least send a "startup" event (think: elixir-ls is being loaded, but client and server haven't exchanged anything yet) followed by, eventually, an "up and running" event?

The discussion above seems to indicate that granular progress information is not easy or impossible to collect. But it would already be helpful if one could know that

  1. “0%”: elixir-ls is indeed starting up (vs. not being loaded because of a user config issue, for example; "Ok, I apparently have elixir-ls correctly configured and it is attached to this file I am working on right now, but it's not yet ready to use") and/or
  2. “100%”: elixir-ls is finally up and running ("Ok, elixir-ls is ready, now I can start using the various LSP features").