-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any plan to support workspace.workspaceEdit.resourceOperations
#4267
Comments
Hmm... so far, we have not implemented those for a mix of many reasons:
None of which are a hard "no". Would you mind sharing a minimal example and steps that would make jdt respond with a rename operation? |
Can probably just rename a class in Java as the files have to match the class name. |
Here is the steps:
mvn archetype:generate -DgroupId=test -DartifactId=test-resource-op -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.5 -DinteractiveMode=false
cd test-resource-op
vim src/main/java/test/App.java
BTW, there is another issue here. In |
Hardly surprising given that is only used with the capability you just added. |
Well... that's another case where JDT is violating the protocol...
|
It's not pretty, but the simplest java rename case works. |
Thank you for your work @bstaletic . Actually, I open this issue for discussing whether this feature was going to support, and how it should be implemented, and then I can make a PR for it. It will introduce changes both in the client side and the server side. In the current design of While waiting for a response, I implemented my own version. In my version, I still keep the sort of chunks. But I split chunks into 3 parts: 1. normal one, 2. chunks related to rename operations, 3. chunks related to delete operations. And I also replace the buffer in the opening window in a rename operation. I hope these codes may be of some help to you. |
To correct myself, everything works, as long as the chunks received are such that sorting does not matter. @fortime Thanks for the effort! I'll have to take a closer look at your implementation later, but one thing in your comment sticks out:
LSP protocol says we need to apply chunks in order of appearance.
If you split work into three categories and then sort the chunks by file name, you will lose the point that in between changes to
That might be a good idea. Will have to play with it. |
I think i has handled this case. The "chunks of rename" is actually a list of filename and chunks tuples. I will keep the chunks of the old file. Sorting will be happened in each tuple accordingly.
chunks will be saved in the
a. chunks of
chunks will be added to the last tuple of
a. chunks of
chunks will be added to the last tuple of |
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
Frequently Asked Questions section.
about to report and couldn't find an answer to my problem. (Example Google
search.)
vim --version
.:YcmDebugInfo
.the
:YcmToggleLogs
command.version) I am using.
my issue, using
vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what Iexpected to happen and what actually happened.
of
instdeleteall.py
(orcmake
/make
/ninja
) including its invocationthat any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
workspace.workspaceEdit.resourceOperations
In Java, a rename operation is needed to refactor the name of a Java Class. Currently, since there is no support of rename operation, eclipse.jdt.ls won't return the rename operation. We must rename the file manually after a refactor. I think this problem may exist in other language too.
Is there any plan to support
workspace.workspaceEdit.resourceOperations
?The text was updated successfully, but these errors were encountered: