Skip to content

LSP: client-initiated work done progress and partial results for requests (workDoneToken, partialResultToken) #2244

Backlog

Description

@lagergren

What

  • Client-initiated work done progress (3.15): the client puts a workDoneToken in a request. The server reports begin, report and end on that token with $/progress, and the client shows it as the progress of that request. Servers say which requests support it with workDoneProgress: true in their options, e.g. referencesProvider: { workDoneProgress: true }.
  • Partial results (3.15): the client puts a partialResultToken in a request. The server then streams the result in chunks with $/progress and answers with an empty result. The requests that allow it include references, implementation, definition, document and workspace symbols, call and type hierarchy, semantic tokens, and both diagnostics pulls.

Why

Server support:

  • typescript-language-server: uses the client's work done token for workspace/executeCommand, e.g. "Go to source definition" (createProgressReporter(token, workDoneProgress), src/lsp-server.ts, src/lsp-client.ts). Without one, it creates its own with window/workDoneProgress/create, which LSP4IJ already shows.
  • basedpyright: announces workDoneProgress: true for definition, declaration and type definition (languageServerBase.ts).

VS Code doesn't use either one for requests either. vscode-languageclient sends a workDoneToken only in initialize, and a partialResultToken only in workspace/diagnostic (client.ts, diagnostic.ts). LSP4IJ does about the same:

Since VS Code doesn't send these tokens, servers rarely depend on them. The exception is initialize. VS Code sends a token there, and clojure-lsp reports its whole startup on it (#750). A user-defined clojure-lsp in LSP4IJ, without an adopter's hook, shows no startup progress.

Apart from initialize, this is the least urgent item of the list.

What users could gain:

  • a progress bar with the server's messages during a long Find Usages, rename or executeCommand;
  • Find Usages and Search Everywhere results that appear as they are found, on very large workspaces.

Today

  • No request but workspace/diagnostic carries a partialResultToken. LSPProgressManager ignores partial results: "TODO: Partial Result Progress" (#L167-L171). WorkspaceDiagnosticManager handles its own.
  • No request carries a workDoneToken that LSP4IJ created. LSPInlineCompletionSupport only copies one from its params (#L101).
  • Server-initiated progress (window/workDoneProgress/create, $/progress, and window/workDoneProgress/cancel when the user cancels) is supported in LSPProgressManager.

How it could be done

First step, small:

  • Send a workDoneToken in initialize by default, as VS Code does.
  • LSPProgressManager.notifyProgress already shows a begin on a token that it doesn't know (LSPProgressManager.java#L186-L193). So the token alone may be enough. Check that cancelling it then sends window/workDoneProgress/cancel, which the spec allows for client-initiated tokens too.
  • An adopter's initializeParams hook can still replace or remove it.

Work done for other requests:

  • For a request whose server options say workDoneProgress: true, LSP4IJ creates a token and sends it with the request. LSPProgressManager handles it as if the server had created it.
  • Candidates: references, implementation, rename, executeCommand, workspace/symbol.
  • The progress then shows as a background task. When the request already runs under a modal or background ProgressIndicator, as Find Usages does, it could drive that indicator's text instead.

Partial results:

  • Only where IntelliJ consumes results incrementally:
    • Find Usages through a Processor in LSPWorkspaceImplementationsSearch and the references search;
    • Search Everywhere through ChooseByNameContributorEx.processNames / processElementsWithName.
  • Register a progress handler for the token that feeds each chunk to the processor, and treat the final (empty) answer as the end.
  • Every consumer must also handle a server that ignores the token and answers in full.

Activity

  1. added
    enhancement
    $/progress
    on Nov 25, 2026
  2. added this to the Backlog milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    $/progressenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions