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
didClose and didOpen events go out of balance when dragging an editor window from the main IDE view to another view #1383
For this particular example, where only onefile2.py view is present, I expected either one of these after dragging:
NeitherdidClose nor didOpen events should trigger
BothdidClose and didOpen events should trigger
However, in the scenario where there was another open editor window of file2.py (so 2 or more views of file2.py in total), then dragging file2.py out should not trigger any didOpen or didClose events (currently, LSP4IJ behaves correctly in this scenario).
I do not know when this problem started occurring; it may have started before the latest release of LSP4IJ. This bug reproduction is for the latest release (v0.18).
I just checked CSS using ESLint with WebStorm, and rust-analyzer with RustRover, and it seems like this problem doesn't occur in those language servers. Both of these were tested with LSP4IJ 0.18 interfacing with user-defined LS.
I thought this should be an LSP4IJ problem, because didOpen and didClose are both client-to-server messages. Do you think it's a possibility that my language server has issues? If so, I'll dig a bit deeper there instead.
Okay so I tested this in PyCharm with another Python language server running simultaneously with mine, and the other language server successfully triggers both didClose and didOpen, whereas my one doesn't.
There's probably a bug somewhere in my language server, so this isn't an LSP4IJ issue.
@bzoracler I dont think it is a bug from your language server.
I think it doesnt work with your language server because it supports none lsp features like doculenrtHighlight. Symbols etc which force the didOpen.
Indeed I did a big perf improvment when you have several language servers and a lot of opened tabs.
When IJ restart, only the visible tab must start the server and not other tabsb which are not visible.
Before didOpen was sent when IJ file open was triggered. Now didOpen is trigerred by the call of lsp request like highlight. I did that because IJ filesopen is called even if tab is not visible.
I added a textDocument/documentHighlight feature to my language server that has no implementation, and textDocument/didOpen triggers now (although, you have to still do something in the new editor window, like type something or click on something to trigger it. Still, this is better than the language client thinking that it's permanently closed).
Activity
angelozerr commentedon Nov 28, 2025
Have you this issue with other language server like CSS or JavaScript?
bzoracler commentedon Nov 28, 2025
I just checked CSS using ESLint with WebStorm, and rust-analyzer with RustRover, and it seems like this problem doesn't occur in those language servers. Both of these were tested with LSP4IJ 0.18 interfacing with user-defined LS.
I thought this should be an LSP4IJ problem, because
didOpenanddidCloseare both client-to-server messages. Do you think it's a possibility that my language server has issues? If so, I'll dig a bit deeper there instead.bzoracler commentedon Nov 28, 2025
Okay so I tested this in PyCharm with another Python language server running simultaneously with mine, and the other language server successfully triggers both
didCloseanddidOpen, whereas my one doesn't.There's probably a bug somewhere in my language server, so this isn't an LSP4IJ issue.
Thanks!
angelozerr commentedon Nov 28, 2025
@bzoracler I dont think it is a bug from your language server.
I think it doesnt work with your language server because it supports none lsp features like doculenrtHighlight. Symbols etc which force the didOpen.
Indeed I did a big perf improvment when you have several language servers and a lot of opened tabs.
When IJ restart, only the visible tab must start the server and not other tabsb which are not visible.
Before didOpen was sent when IJ file open was triggered. Now didOpen is trigerred by the call of lsp request like highlight. I did that because IJ filesopen is called even if tab is not visible.
bzoracler commentedon Nov 28, 2025
Oh, so this is somewhat related to #1224.
Thank you! In that case I'll reopen this for now.
bzoracler commentedon Nov 28, 2025
Yes, your suspicion was right.
I added a
textDocument/documentHighlightfeature to my language server that has no implementation, andtextDocument/didOpentriggers now (although, you have to still do something in the new editor window, like type something or click on something to trigger it. Still, this is better than the language client thinking that it's permanently closed).fix: a file whose editor moves to another window stays open in its la…