ContextKeeper / ContextKeeper.VisualStudio

Session Manager for Visual Studio
15 stars 0 forks source link

Bookmarks & Breakpoints not removed when switching to a snapshot without #11

Open itlee23 opened 11 months ago

itlee23 commented 11 months ago

I have 2 snapshots, "A" with bookmarks and breakpoints and another "B" without. When switching from A to B the bookmarks & breakpoints are still listed in VS, removing them and saving snapshot B and switching to A and back to B the bookmarks & breakpoints are still listed.

In short, bookmarks & breakpoints are not removed and then updated from the snapshot.

PiotrKarczmarz commented 11 months ago

When a snapshot is restored, old breakpoints & bookmarks are removed, but only for those files from a snapshot. If breakpoints & bookmarks exists in other files than from snapshot "A", they won't be touched (removed).

I assume this is happening in your scenario - e. g snapshot "A" has file1, file2 and file3 (breakpoints & bookmarks) and snapshot B has file4, file5 (no b&b). Opening snapshot "A" and later snapshot "B" will leave those breakpoints & bookmarks untouched.

This is default "minimal" implementation, but there are some cases, like yours, but also others, when this design fails and it needs to be improved.

itlee23 commented 11 months ago

Thanks for the response, I had considered that was the case, but if I am loading a snapshot I'd expect them to be removed, and if I need them I should update the snapshot before switching. As is the purpose to switch context with the task and those B&B are no longer relevant for this task.

If I compare a snapshot to a document, closing it without saving thus losing work that's on me, but if I open a document and there is text from the previous document that is a WTF result.

Look forward to a potential update to this functionality. Thanks

YZN3RF commented 3 weeks ago

Initially I also expected ContextKeeper to save / restore breakpoints for each snapshot. I always found it confusing to have breakpoints from snapshot "B" in snapshot "C", because they are most of the time completely irrelevant in that snapshot.

I kind of got that "ContextKeeper induced breakpoint mess" under control, by consequently removing all breakpoints in my Git "master" branch. Which helps, since I usually create new branches from the master branch.