Enhance unused reference feature to support undo/redo
See original GitHub issueWe would like the API implemented in https://github.com/dotnet/project-system/pull/6692 enhanced with the ability to re-add a reference that has been removed.
One possibility is a new UpdateAction.Add
In particular the call to IProjectSystemReferenceCleanupService.GetProjectReferenceAsync
would need to be enhanced so that we capture enough information about each reference that it could be recreated from the ProjectSystemReferenceInfo model. This information may need to include the position in the project file where the reference would be inserted. Next the IProjectSystemReferenceCleanupService.TryUpdateReferenceAsync
would need to be updated to support an ProjectSystemUpdateAction.Add
scenario where, given this enhacned ReferenceInfo model, a reference is added to the project file.
Another possibility is that we share the same undo context
The IProjectSystemReferenceCleanupService.TryUpdateReferenceAsync
could return a OleUndoUnit or we could pass in a UndoTransaction of sorts.
Tracked in DevOps 1348735
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (17 by maintainers)
@jjmew It would be coarse-grained but we could have the proposed
Undo()
andRedo()
methods return bool indicating success. We would then inform the user on our end.@ocallesp do you recall which version this was fixed in?