refactor: ensure that we only keep one snapshot for a file
Description
This MR is a follow up for this conversation !2664 (comment 2553056781)
It ensures that if multiple applyEdits affect the same file, we only take the snapshot once and keep it until all applyEdits dispose the snapshot reference.
Related Issues
Issue [VS Code] [Chat-driven edit] Show changes in si... (#1995 - closed)
How has this been tested?
This can't be simulated in the extension. I added a unit test to simulate the edge case.
What CHANGELOG entry will this MR create?
-
fix:Bug fix fixes - a user-facing issue in production - included in changelog -
feature:New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes