-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: Problem recreating a renamed resource #42634
Comments
The output shows that all edits were grouped together, although they belong to different resources |
Same problem when recreating a deleted resource:
|
@bpasero This doesn't seem to work. I have added this test https://github.com/Microsoft/vscode/blob/7631f97270bbb638e270898fa3efd754b2015483/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts#L592 and it fails because the newly created file has contents from the old file (the one that got renamed). To repro
|
@jrieken the original issue from @aeschli no longer reproduces and the file is created just fine with the " As for the test, I actually don't know how to fix it to run green without causing a flaky test. The issue is this: Running Martins Code
Running the Test
I could in theory fix this by just destroying the model in When I actually change the test to open the document in the editor first, the test succeeds 50% of the times, which is odd because it means there is a timing issue with reacting to the editor getting closed. If there was a way for the test to somehow synchronize on that event we could probably make it more robust, but for now I do not want to push a flaky test... |
One less aggressive and more pragmatic approach would be to reset the model, e.g. set its value to
Hm, it'd expect 100% failure because |
Testing #42334
Run the extension below.
-> you end up with an error dialog:
Failed to save 'package.json': The content on disk is newer.
All edits are applied to the old resource name
The text was updated successfully, but these errors were encountered: