Skip to content

Workspace diagnostics stop when the server cancels a pull itself #2027

Closed

Description

@lagergren

WorkspaceDiagnosticManager pulls again after a ContentModified answer, or after ServerCancelled unless its data says not to retrigger. Any other error stops the pulls until the next workspace/diagnostic/refresh or registration, so that a server that fails the method isn't asked over and over.

A server built on LSP4J has no way to answer ServerCancelled for a pull it cancels itself, such as one that newer work supersedes: LSP4J answers RequestCancelled for any request whose future the server cancels (RemoteEndpoint.handleRequest), not only for one the client cancelled. LSP4IJ takes that answer as a failure, logs "Workspace diagnostics stopped" and stops pulling, so the diagnostics of closed files go stale until the server refreshes.

A pull that LSP4IJ cancels completes at once with a CancellationException, and a late answer to it is ignored. So a RequestCancelled answer that reaches shouldRetrigger always comes from a server that cancelled the pull itself, and pulling again is as safe as after ServerCancelled.

Found while moving xtclang/xvm to LSP4IJ 0.30.1. Its LSP4J server answers RequestCancelled for pulls it cancels itself; in its playbook runs a refresh has followed each such answer, which started the pulls again, so a stall hasn't shown there. A server that cancels a pull without a refresh stops getting pulls.

Activity

  1. added this to the 0.30.2 milestone on Nov 20, 2026
  2. added a commit that references this issue on Nov 21, 2026
    9e7f1e8
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions