Skip to content

Show $/progress loading status in modeline during rust-analyzer initialization #1298

@not-null-nil

Description

@not-null-nil

When opening a Rust file in a large project (e.g. Bevy), rust-analyzer goes through several initialization stages before it is ready to serve completions and diagnostics. During this time, lsp-bridge gives no visual feedback, so the user has no way to tell whether the LSP is still loading or has already failed silently.
What rust-analyzer sends
Throughout initialization, rust-analyzer emits a series of $/progress notifications with begin / report / end lifecycle events. The key tokens, are:

rustAnalyzer/Fetching
rustAnalyzer/Building CrateGraph
rustAnalyzer/Loading proc-macros
rustAnalyzer/Roots Scanned (carries a message field like "230/577")
rustAnalyzer/Indexing

This is already documented in the LSP spec as window/workDoneProgress, and lsp-bridge's log shows it is already receiving these notifications (#1100).

Expected behavior
Between the begin and end of these progress tokens, the modeline should show a loading indicator such as:
[rust-analyzer load-icon 230/577]
Once the final stage ends, the indicator should be cleared. This matches the behavior VS Code and lsp-mode(emacs-lsp/lsp-mode#707) provides out of the box — it shows a spinner in the status bar with the current stage name and progress during the entire initialization window.

Image (the picture is token from here: https://www.youtube.com/watch?v=jq-zvM4Ih14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions