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 connected for a request without an editor stays connected after the file is deleted #2335
LanguageServiceAccessor.getLanguageServers(file, …) connects the file to each matched language server (didOpen)
whether or not an editor has it open. LSPDebugVariablePositionProvider.getVariableLookups does this for a suspended
frame's file, also on each workspace/inlineValue/refresh. A document connected that way stays connected for good:
when its file is deleted, no textDocument/didClose is sent;
getOpenedDocuments() keeps an OpenedDocument whose VirtualFile is no longer valid, and that document's
diagnostics keep being pulled;
when a file is created again at the same URL, connectDocument reuses the stale document
(getConnectedSynchronizer), so the server keeps the deleted file's text.
Steps
Debug a program with a language server that supports textDocument/inlineValue, and stop in A.x.
Close A.x's editor, so no editor has the file.
Have the server send workspace/inlineValue/refresh. LSP4IJ sends textDocument/didOpen for A.x, with no editor.
Delete A.x.
Expected:textDocument/didClose for A.x once its file is deleted (and, ideally, once no request needs a document
that has no editor).
Actual: no didClose. A.x stays in getOpenedDocuments() with an invalid file, its diagnostics keep being
pulled, and a new A.x at the same URL is served the deleted text.
Where we saw it: the Ecstasy language server's IntelliJ playbook (xtclang/xvm). A debug case stopped in a file,
its cleanup deleted the file, and the document stayed connected. Our rename's check, which compares the documents a
rename saw with those open when it applies, then counted the invalid file as a change and refused every later rename
and move. We now tolerate a file that was already deleted before the request; that tolerance can go once a deleted
file's document is disconnected.
Activity
Record IntelliJ's full-catalog fixes, UP93 filed as lsp4ij#2335, and …