-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Inline rename couldn't rename a file #56467
Comments
@genlu we're hitting this multiple times. Can we revisit this design? What was the context we originally needed to have |
I remember making changes to exclude editable document by querying |
@genlu I see... IMO it'd be nice to just remove this check. The only thing that will happen without it is that the change will fail if it actually can't be modified. Having this check only adds another point of failure for us. |
Maybe showing a warning in goldbar and skip the problematic file, instead of removing the check completely? |
@davidwengier let me guess, that file is referenced in multiple projects/multitargeting? |
I can't remember exactly, but looking at the nav bar, yes it seems like it would have been a multi-targeted project. |
Remove single check for EnsureEditableDocuments on each document. This was duplicating the work that the call in TryApplyChanges does, and can have conflicts with linked files. For example: If file A.cs is renamed to B.cs and is in 2 projects Each project will go through and apply changes (lets call P1 and P2) P1 goes through and calls: ApplyTextChange > EnsureEditable > Rename File (File is now B.cs on disk) P2 goes through to do the same as P1, but A.cs no longer exists so EnsureEditable will fail (can't check status of a file that doesn't exist) We should be doing all the work to check edit status upfront so it doesn't collide with the actual edits we need to do. TryApplyChanges is already overridden and does that. This change just removes the extra work we were doing that also created problems for renaming files. Fixes #56467
Version Used: Version 17.0.0 Preview 5.0 [31715.371.main]
The text was updated successfully, but these errors were encountered: