Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove extra EnsureEditableDocuments calls (dotnet#57725)
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 dotnet#56467
- Loading branch information