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: create file - overwrite and ignoreExists can conflict #52919

Closed
isidorn opened this issue Jun 26, 2018 · 6 comments
Closed

WorkspaceEdit: create file - overwrite and ignoreExists can conflict #52919

isidorn opened this issue Jun 26, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workspace-edit
Milestone

Comments

@isidorn
Copy link
Contributor

isidorn commented Jun 26, 2018

Refs: #52800

Have an extension with the following WorkspaceEdit

workspaceEdit.createFile(vscode.Uri.file('c:\\Development\\Test\\hello2.txt'), {
            overwrite: true,
            ignoreIfExists: true
        });

Notice that those two settings are conflicting and it is nowhere specified that ignoreIfExists has priority - which is what I see in practice.

@isidorn isidorn changed the title WorkspaceEditr: create file weird if overwrite and ignoreExists both true WorkspaceEdit: create file - overwrite and ignoreExists can conflict Jun 26, 2018
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug workspace-edit labels Jun 26, 2018
@jrieken
Copy link
Member

jrieken commented Jun 26, 2018

Yeah, "make illegal states un-representable" they said...

@jrieken jrieken modified the milestones: June 2018, July 2018 Jun 26, 2018
@jrieken
Copy link
Member

jrieken commented Jun 27, 2018

needs inspiration, moving to July since this is proposed only. Maybe remove ignoreIfExists...

@jrieken
Copy link
Member

jrieken commented Jul 16, 2018

Yeah, I think we will just document this and overwrite will win

@isidorn isidorn added verified Verification succeeded and removed verified Verification succeeded labels Jul 31, 2018
@isidorn
Copy link
Contributor Author

isidorn commented Jul 31, 2018

@jrieken in your comment you say that "overwrite wins" however I was seeing that ignoreIfExists wins. Did you change some other behavior that now results in different behavior here.
Reopening just so you see my comment and moving to august

@isidorn isidorn reopened this Jul 31, 2018
@isidorn isidorn modified the milestones: July 2018, August 2018 Jul 31, 2018
@isidorn isidorn added the verification-found Issue verification failed label Jul 31, 2018
@jrieken
Copy link
Member

jrieken commented Aug 6, 2018

Yeah, this was really implemented, not just a doc change. See https://github.com/Microsoft/vscode/blob/7289c303db9c6437489b08e558a83a11ff063438/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts#L712

@jrieken jrieken closed this as completed Aug 6, 2018
@jrieken jrieken removed the verification-found Issue verification failed label Aug 6, 2018
@isidorn
Copy link
Contributor Author

isidorn commented Aug 28, 2018

Verified it works as documented now

@isidorn isidorn added the verified Verification succeeded label Aug 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workspace-edit
Projects
None yet
Development

No branches or pull requests

2 participants