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 reconnect queued for a moved document starts a language server that a stop switched off #1912
A reconnect of a moved document that was queued before stopAndDisable() starts the language server again once it runs. The language server is then running while it is switched off.
How it happens
When a file whose document is connected is renamed or moved, LSPFileListener.onFileRenameAfter disconnects the document and calls reconnectMovedDocument(VirtualFile), which connects it again on the EDT, after the write action. For a language server without instances, that ends in reconnectMovedDocument(LanguageServerWrapper, VirtualFile), which calls connect() without checking isEnabled(). connectDocument then calls start(), which doesn't check it either. Only the path of an instance checks instance.isEnabled() first.
So a stop between the move and the queued reconnect doesn't keep the language server off. A test on main renames an open file whose document is connected, calls stopAndDisable() before the EDT runs the queued reconnect, and then lets it run: isEnabled() is false, but isActive() is true and the file is synchronized again.
#1911 adds two more ways to that reconnect: a document that the move of its file missed, and an open file whose connection dropped because the file moved.
Possible fix
Check isEnabled() in reconnectMovedDocument(LanguageServerWrapper, VirtualFile), which every reconnect goes through:
if (!isOpenDocument(languageServer, file) || !languageServer.isEnabled()) {
With it, the test passes, and so do the tests of moves, renames, file operations and instances.
Fixed by #1911 (766184d), merged as 2253ca0: the reconnection of a moved document checks isEnabled() before it connects, now for a language server without instances too, so a stop between a move and its queued reconnection keeps the language server off. #1911's description names it with the same "Fixes" as #1904, which GitHub takes for #1904 only.
Activity
lagergren commentedon Nov 9, 2026
Fixed by #1911 (766184d), merged as 2253ca0: the reconnection of a moved document checks
isEnabled()before it connects, now for a language server without instances too, so a stop between a move and its queued reconnection keeps the language server off. #1911's description names it with the same "Fixes" as #1904, which GitHub takes for #1904 only.