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

Dataloss when renaming file two times #211374

Closed
Xanadu333 opened this issue Apr 25, 2024 · 3 comments
Closed

Dataloss when renaming file two times #211374

Xanadu333 opened this issue Apr 25, 2024 · 3 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member file-explorer Explorer widget issues file-io File I/O insiders-released Patch has been released in VS Code Insiders workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@Xanadu333
Copy link

Xanadu333 commented Apr 25, 2024

Hello everyone.

Microsoft has a lot of text editor on their different products and I have come to a way of working (which might not be the best of all in some cases) and it seems like using Visual Studio Code in a manner allows the customer, like myself, to be loosing its file progress when renaming a file.

This happened after I wanted to rename a java class, for example, “myclass.java” to “MyClass.java”.
Since the change lookup is case insensitive, they both are of equal names which will result in no name change, so you will have to rename the file to a temporary name in order to make your change.

Now the following process will come in to the bug to be fixed.

  • Create a new file name “myclass.java”.
  • Enter the following code into that file (replace the content if necessary):
public class myclass
{
    public myclass()
    {

    }
}
  • Now save the file.
  • Now add this method to the class:
...
    public void myMethod()
    {
        // My work in progress...
    }
  • Now without saving this time. Rename the file using the right-click in the object-browser pane of the VSCode to “temporaryname.java”. You will see the file has the same content but with the new name.
  • Now rename the file again like before to “MyClass.java”. Now, it will be taking the last saved file named “myclass.java” and take its content instead of taking the current file content. Therefore loosing all work in progress. In this case, the class myclass will no longer have the method myMethod(), and there will be an error from the intellisense since the class myclass does not equal MyClass.

Now I know that saving will fix all of this. BUT, Microsoft, as a reliable source for text editing, at least I would have liked a minimum of a prompt of “Are you sure you want to rename the file to "newNameFile"? The work in progress might be loss.”

This is very common for I to do this in other Microsoft text editing products and this seems to be a bug to be fixed. Allowing the customer to loose its progress without warning is a bug to me.

All thanks.

@lramos15 lramos15 added bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues labels Apr 25, 2024
@lramos15
Copy link
Member

Not sure if this is an explorer issue or a file system issue cc @bpasero .

Just assigned to me for now because the bot did

@bpasero bpasero assigned bpasero and unassigned lramos15 Apr 25, 2024
@bpasero bpasero added confirmed Issue has been confirmed by VS Code Team member and removed confirmation-pending labels Apr 25, 2024
@bpasero bpasero added this to the April 2024 milestone Apr 25, 2024
@bpasero
Copy link
Member

bpasero commented Apr 25, 2024

This is an excellent bug report and no, this should not happen, sorry for that. Will have a look!

@bpasero bpasero modified the milestones: April 2024, May 2024 Apr 25, 2024
@bpasero bpasero added file-io File I/O workbench-editors Managing of editor widgets in workbench window labels Apr 25, 2024
@bpasero bpasero changed the title Loosing progress on renaming file Dataloss when renaming file Apr 25, 2024
@bpasero bpasero changed the title Dataloss when renaming file Dataloss when renaming file two times Apr 25, 2024
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Apr 26, 2024
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 2, 2024
@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label May 3, 2024
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@Xanadu333, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 03dd3c3 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member file-explorer Explorer widget issues file-io File I/O insiders-released Patch has been released in VS Code Insiders workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

4 participants