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

Renaming in new WorkspaceEdit api #42671

Closed
gushuro opened this issue Jan 31, 2018 · 2 comments
Closed

Renaming in new WorkspaceEdit api #42671

gushuro opened this issue Jan 31, 2018 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) workspace-edit

Comments

@gushuro
Copy link
Contributor

gushuro commented Jan 31, 2018

Testing #42334

When renaming from.txt -> to.txt using the new api, if to.txt already exists, nothing happens.
I'd expect the other file to be overwritten, though it would also make sense to leave it as it is and make renameResource to return some value that represents that the renaming didn't happen.

@gushuro
Copy link
Contributor Author

gushuro commented Jan 31, 2018

Another problem I found was renaming and then modifying the new file.

For example:

let we = new vscode.WorkspaceEdit();
we.renameResource(currentUri, newUri);
we.insert(newUri, position, "InsertText");
vscode.workspace.applyEdit(we);

Does the rename but doesn't insert the text in the new file.

Creating a new WorkspaceEdit doesn't work as expected either

let we = new vscode.WorkspaceEdit();
we.renameResource(currentUri, newUri);
vscode.workspace.applyEdit(we);

let we2 = new vscode.WorkspaceEdit();
we2.insert(newUri, position, "InsertText");
vscode.workspace.applyEdit(we2);

@jrieken jrieken added this to the February 2018 milestone Feb 1, 2018
@jrieken jrieken modified the milestones: February 2018, March 2018 Feb 27, 2018
@jrieken jrieken removed this from the March 2018 milestone Mar 8, 2018
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 19, 2018
@vscodebot
Copy link

vscodebot bot commented Jun 19, 2018

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jun 19, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) workspace-edit
Projects
None yet
Development

No branches or pull requests

2 participants