Skip to content

A file that opens after its published errors were fixed elsewhere stays red in the Project view #1861

Closed

Description

@lagergren

When a language server has published errors for a file that isn't open, LSP4IJ keeps them in the file's ClosedDocument and reports the file to IntelliJ's problems (WolfTheProblemSolver), so the Project view shows it in red. If an edit in another file fixes those errors, and the file opens before the server publishes for it again, the file stays red:

  • LanguageServerWrapper.connect removes the file's ClosedDocument (closedDocuments.remove(fileUri)) and doesn't report the file again.
  • The new OpenedDocument starts without errors, and its first diagnostics have none either, so updateDiagnostics sees no change in hasErrors() and doesn't call LSPDiagnosticUtils.reportProblem.
  • WolfTheProblemSolver keeps the problem that was reported for the closed document, until the open file gets an error and loses it again.

stop() clears the problems of the closed documents it drops (clearProblem(fileUris, ...)); connect drops one without that.

A proposal: when connect removes a closed document that had errors, report the file again with LSPDiagnosticUtils.reportProblem(file, null, project), which also looks at the other servers' documents, so that the problems follow what LSP4IJ holds now.

Seen with 0.21.0 and main (1988ab6c). We ran into it with the Ecstasy language server (XVM), which publishes the errors of files that aren't open.

Activity

  1. added a commit that references this issue on Nov 5, 2026
    02d0650
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions