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 document can miss the move of its file while its connection is in progress #1904
Follow-up to #1891, which closed the race between a move and a connection that registers the document of the moved file: the move now checks and disconnects the document in one step under documentsLock, as the connection checks the place of its file and registers the document. Three cases stay open, because the listener of the move doesn't see them, as @d-biehl described in the review of #1891:
A language server without file operations.getSupportedEvents keeps the move of a file only if the file is open as prepareChange runs. A document registered after that check, and before the move, gets no onFileRenameAfter, so it stays connected at its earlier place. (CodeRabbit's thread)
A moved directory. It takes its documents along in beforeVfsChange, before the move, where the check of a connection in progress still sees the earlier place, so the connection registers the document there.
A dropped connection. A connection whose file moved since it was asked for doesn't register the document, and the move has no document to take along, so the open file gets no didOpen, and no language features from that server, until another request connects it. (CodeRabbit's thread)
None of them is new with #1891: the first two were possible before it, and in the third, the connection used to open the file at its earlier place instead.
Possible direction
After a move, the listener could also take along every document whose file has another URI now, and connect the open files whose place changed. That needs an applier for every batch with a move or rename, whatever getSupportedEvents keeps, so it gives back some of what the filter of #1884 saves.
@d-biehl, you offered to take these on in #1891; this issue is for that PR.
Activity