PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

After Save As with a different name, clicking on the original file in the project jumps to the window with the new name

Open vsfeedback opened this issue 1 year ago • 0 comments

This issue has been moved from a ticket on Developer Community.


  1. Open a file from a .pyproj project, for example, aaa.py
  2. Enable "Show All Files" (a button on top of Solution Explorer tab).
  3. Do File->Save As command and save it as bbbb.py.
  4. Switch to a different editor window.
  5. Double click on aaa.py in the project, to open the original file. bbbb.py window will be activated, instead.

This is a result of a mis-conceived design decision, combined with a couple of bugs:

  1. "Save As" for a file in a project renames the file in the project, instead of adding it with a new name. Because Show All Files is enabled, the file with old name is still shown in the project tree, along with the new file. Also the new file is shows with faded icon, as a file not in the project. If we're going to automatically apply Save As to a file in the project, it would make more sense to add the newly saved file, instead of renaming the original file in the project.
  2. Even though the project is modified by a rename, it's not marked as modified, it's not shown as modified in Git Changes tab, and Save All doesn't save it. Only when the project is closed, it gets saved with the new name.

Also, with an open solution, and Show All Files enabled, Save As on a file which is not included in the project may rename it in the project view, instead of adding with a new name (the new file is correctly saved alongside with the original file, and appears as an added file in Git Changes tab).


Original Comments

Feedback Bot on 12/3/2023, 06:59 PM:

(private comment, text removed)


Original Solutions

(no solutions)

vsfeedback avatar Dec 04 '23 20:12 vsfeedback