You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A file that opens after its published errors were fixed elsewhere stays red in the Project view #1861
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
fix: close the gaps CodeRabbit found in #1864 and #1865 (#1867)
fix: report a file again when its closed document is dropped as it opens
fix: clear a closing file's problem from the errors held when it runs (…