Skip to content
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

WorkspaceEdit and File Level Operations #272

Closed
tsmaeder opened this issue Jul 21, 2017 · 14 comments
Closed

WorkspaceEdit and File Level Operations #272

tsmaeder opened this issue Jul 21, 2017 · 14 comments
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities proposal-provided

Comments

@tsmaeder
Copy link

A rename operation, for example returns a WorkspaceEdit operation. However, when renaming a Java class, for example, I expect the file to be renamed as well. Is there a way to express that in LSP?

@rcjsuen
Copy link
Contributor

rcjsuen commented Jul 21, 2017

See also #41 and #191.

@mickaelistria
Copy link

What about a simple delete: true flag to mark the previous file as deleted (flag to be added to protocol) + a regular TextEdit with whole content of the new file?

@dbaeumer
Copy link
Member

I agree that we should expand the WorkspaceEdit with a resourceChanges property which allows for the following resource operations:

  • create (with content)
  • move (includes rename)
  • delete

This would solve the rename refactoring as as well.

@dbaeumer dbaeumer added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities labels Nov 17, 2017
@dbaeumer dbaeumer added this to the Next milestone Nov 17, 2017
@dbaeumer
Copy link
Member

A proposal is highly appreciated.

@gorkem
Copy link
Contributor

gorkem commented Mar 27, 2018

@dbaeumer I think this one needs a proposal-provided label also

@dbaeumer
Copy link
Member

dbaeumer commented Apr 9, 2018

Agree.

@tsmaeder
Copy link
Author

tsmaeder commented Oct 16, 2018

@dbaeumer I have seen there is support for resource change now in LSP. However, what's missing from my point of view is the creation of folders. If I have a rename or a delete, I know whether I am dealing with a folder or a file, But in a create, I have no way of knowing. Shouldn't "isFolder" be added to CreateFileOptions? The spec even references the possiblity to change folders, but it's not in the code.

@dbaeumer
Copy link
Member

dbaeumer commented Nov 6, 2018

@tsmaeder correct :-). All I can recommend right now is to create a file in the folder and then delete the file.

I will keep the request open to support creating a folder. Will very likely be an additional property / param type: 'file' | 'folder'

@dbaeumer
Copy link
Member

dbaeumer commented Nov 6, 2018

See also microsoft/vscode#62663

@yaohaizh
Copy link

yaohaizh commented Nov 9, 2018

@dbaeumer
For the workaround, on my windows' desktop, I always disabled recycle bin support. So the work around will pop up with text Failed to move 'fakeFile' to the recycle bin
This workaround is kind of issue if customer doesn't support recycle bin or have to enable options files.enableTrash: false

Either way, it is not decent workaround at this time.

@testforstephen
Copy link

Refactor package name is really an important feature for Java language, without creating/deleting folder support in LSP level, it's hard to bring this feature to jdt.ls.

@dbaeumer is there any update about this issue? Or any help i can provide to solve it? thanks.

@dbaeumer
Copy link
Member

dbaeumer commented Jul 5, 2019

@testforstephen thanks for offering your help. Things needed to be done to make this work:

Should not be too complicated. I would start with the VS Code work and then add the LSP resource change.

@testforstephen
Copy link

great, thanks for the explanation. Looking forward to see it's solved.

@dbaeumer
Copy link
Member

This got added a while back ago.

@dbaeumer dbaeumer removed this from the On Deck milestone Oct 31, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities proposal-provided
Projects
None yet
Development

No branches or pull requests

7 participants