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
‘workspace/didRenameFiles’ is not sent if workspace/willRenameFiles is not supported by language server #1216
Server Capability workspace.fileOperations.didRename is set on LS side.
Not set Server Capability _ workspace.fileOperations.willRename_ on LS side.
Steps to reproduce:
Open any supported file by LS and rename the file.
Expected result:
Client sends the request ‘workspace/didRenameFiles’ to the LS
Actual result:
Client doesn't send the the request ‘workspace/didRenameFiles’
Technial notes:
In this case in the class com.redhat.devtools.lsp4ij.features.refactoring.LSPRefactoringListener#refactoringDone LSPRenameFilesContextHolder.get() returns null because it was not set in com.redhat.devtools.lsp4ij.features.refactoring.LSPRenamePsiElementProcessor as LS doesn't support willRename operation.
LSPRenameFilesContext context = LSPRenameFilesContextHolder.get(); if (context != null) {
To be honnest with you it was a long time that I have implemented this didrenameFiles which worked pretty well with all language servers like Go, TypeScript, Rust, etc
Currently, didRenameFiles notifications are only sent to language servers that:
support willRenameFiles capability
have successfully executed willRenameFiles request
Expected behavior
didRenameFiles notifications should be sent to any language server that supports the didRenameFiles capability, regardless of:
whether they support willRenameFiles
whether willRenameFiles was executed successfully
Some language servers may want to be notified about file renames even if they don't support or didn't handle the willRenameFiles request. The current implementation prevents these servers from receiving the notifications they're capable of handling.
So, the didRenameFiles notification is part of the LSP file operations capability and should operate independently from willRenameFiles support.
@angelozerr The language server is being developed at my current employer and is not open source (internal project).
Also, I currently have about three open issues that appeared after migrating to lsp4ij. I plan to open separate issues for them as well. Could you advise which language server is best to use to reproduce these problems when filing bugs and to verify the behavior?
@angelozerr The language server is being developed at my current employer and is not open source (internal project).
OK
Also, I currently have about three open issues that appeared after migrating to lsp4ij. I plan to open separate issues for them as well. Could you advise which language server is best to use to reproduce these problems when filing bugs and to verify the behavior?
It depends on feature. I have tried to write several tests wich emulates language server. Unfortunately I have no test with rename files
Activity
angelozerr commentedon Aug 13, 2025
Is there any chance to have a PR?
sergeysavchuk commentedon Aug 13, 2025
@angelozerr Hello, I can prepare a fix in the next few days, but I’m not sure it’s correct yet — needs testing.
angelozerr commentedon Aug 13, 2025
To be honnest with you it was a long time that I have implemented this didrenameFiles which worked pretty well with all language servers like Go, TypeScript, Rust, etc
I don't understand very well your issue.
fix: Send didRenameFiles notifications to any language server that su…
sergeysavchuk commentedon Aug 19, 2025
@angelozerr hello, there are more details:
Current behavior
Currently, didRenameFiles notifications are only sent to language servers that:
Expected behavior
didRenameFiles notifications should be sent to any language server that supports the didRenameFiles capability, regardless of:
Some language servers may want to be notified about file renames even if they don't support or didn't handle the willRenameFiles request. The current implementation prevents these servers from receiving the notifications they're capable of handling.
So, the didRenameFiles notification is part of the LSP file operations capability and should operate independently from willRenameFiles support.
please review #1223
angelozerr commentedon Aug 19, 2025
Thanks so much for your PR.
Your PR looks good but I need to test with other language servers if it doesnt break their file renames
angelozerr commentedon Aug 19, 2025
Just few questions. Which language server requires rhis fix? Do you use an IJ plugin or user defined ls?
If you are using user defined ls, perhaps it could be a good idea to provide an lsp template like other ls.
If you could be interested with this lsp template please tell me and I will give you more infos how ro do that.
sergeysavchuk commentedon Aug 20, 2025
@angelozerr The language server is being developed at my current employer and is not open source (internal project).
Also, I currently have about three open issues that appeared after migrating to lsp4ij. I plan to open separate issues for them as well. Could you advise which language server is best to use to reproduce these problems when filing bugs and to verify the behavior?
angelozerr commentedon Aug 20, 2025
OK
It depends on feature. I have tried to write several tests wich emulates language server. Unfortunately I have no test with rename files
fix: Send didRenameFiles notifications to any language server that su…
fix: Send didRenameFiles notifications to any language server that su…