Skip to content

Go to Declaration, Implementation, Type Definition and References report a cancelled request as "No … found", in a modal dialog once the editor has closed #2093

Closed

Description

@lagergren

When the request of an LSP Go to action ends without an answer, because it was cancelled or failed, LSP4IJ still reports that nothing was found. If the action's editor has closed by then, it reports it in a modal error dialog:

Request Action's editor LSP4IJ shows
answered with no locations open the error hint "No Implementation found." (expected)
cancelled or failed open the same hint, for a lookup that never finished
cancelled or failed closed a modal "Error: No Implementation found." dialog

The same holds for Go to Declaration, Type Definition and References, with their messages. Seen with LSP4IJ 0.30.0; main (f680eb2) has the same code.

How we met it

Our UI test runs LSP.GotoImplementation in an editor and closes the file soon after. The server has an implementation at that position, and returns it to a direct textDocument/implementation. LSP4IJ's request ended unanswered when the file closed, and a modal "Error: No Implementation found." dialog opened over the IDE. Every later step of the test then waited behind it.

A user meets it by closing an editor while its Go to request runs: a modal error then says nothing was found, for a lookup they have left. Cancelling the "Find implementation(s) of …" progress shows "No Implementation found." for a lookup they stopped.

Cause

  • AbstractLSPGoToAction runs the request in a cancellable Task.Backgroundable. Its finally turns a future that didn't complete normally into an empty list, and passes that to findShowUsagesInPopup as if the server had answered with no locations. getLocations ignores a CancellationException (for instance in LSPGoToImplementationAction), and a ProcessCanceledException from Cancel still runs the finally.
  • LSPUsagesManager.showNoUsage shows the message as an error hint in the action's editor, and, when the DataContext no longer has an editor, with Messages.showMessageDialog, which is modal.

Suggested fix

  • Report "No … found" only for a request that completed normally with no locations. A cancelled request shows nothing, and a failed one at most a log entry.
  • Don't open a modal dialog for it. Without an editor, show nothing: the user has left the place they asked about.

Activity

  1. added this to the 0.30.2 milestone on Nov 22, 2026
  2. added 2 commits that reference this issue on Nov 23, 2026
    95b51cc
    1fc8fa9
  3. 20 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions