Your favorite files and contexts under your fingertips. Safely store and switch between documents sets in seconds using simple JSON files π₯ Save progress on tasks easily! ContextKeeper is a modern replacement for Save All Tabs extension.
π« Automatically switch contexts when changing Git branches and check article about it.
π‘ ContextKeeper is currently in the Open Beta, if you will find any issues please report them.
Are you use using Favorite Documents, Workspace Manager or Task Canvas? Check how much value ContextKeeper delivers when compared to them.
Looking for ARM-compatible build or VS 2019/2017/2015 support? Download from here.
logical state
visual state
Join the revolution and install it today! Save at least 3300 minutes/year = 55 hours = 2.3 days (15 mins x 20 days x 11 months). You need about 15 minutes to fully switch between contexts at the best possible scenario.
In worst case scenarios switching to detailed context could take several hours, one of the real horror stories:
"Losing this functionality interrupts my workflow beyond imagination. The opened documents represent a "bookmark" for me and I'm barely able to pick up work again without them.
Every time this happens (...) I am willing to put hours into finding a solution, because the thought of losing my opened document state once more after a work session is terrifying. But this time around (...) nothing of the usual remedies helps (...) This has added another 20 Minutes and counting to my two hours put into solving this."
With ContextKeeper you could safely store and switch between different programming contexts in seconds π₯
All opened files, pinned tabs, documents positions and state (horizontal/vertical orientation, docked state and files order), breakpoints and bookmarks are preserved in a simple JSON file π No more dealing with broken .suo file again.
After installing VSIX package you could access your latest Mental Snapshots by navigating to
By default tool window will open next to Solution Explorer
Tool
You could create a new snapshot using Create Snapshot button
and restore them quickly using few commands from right-click context menu
When switching to another git branch ContextKeeper will automatically remember current branch snapshot and save it to .contextkeeper/.git-branches folder. Also it will be added to the "Mental Snapshots" UI list at the very top with
This is the same process that you could do manually before switching branches but now fully automated for your convenience π₯. The current branch snapshot is always continuously auto-saved when you add, remove or change position of any document tab or window (with tabs).
Also a git branch could be changed from CLI, Visual Studio or other third-party client and ContextKeeper will detect it auto-magically π§ββοΈ and restore snapshot for currently selected branch.
Generally, when a snapshot is created, breakpoints and bookmarks are saved only for the currently open files. This behavior differs from that of Visual Studio, which remembers all breakpoints and bookmarks across different sessions for all files. However, I believe that saving them only for open files is more practical. I remember countless examples of finding old breakpoints from days before that were no longer relevant because I was working on a different task.
The second important thing is that when they are restored for a file, all old breakpoints or/and bookmarks are removed if there were any, but only for that file and nothing else.
Standard and conditional breakpoints are currently supported. When breakpoint is disabled it will be still saved to a snapshot with IsEnabled
property set to false
and restored in a disabled state later in the Visual Studio. A single conditional expression is supported with two modes Is true
and When changed
Although the supported area is probably enough for about 90-95% of use cases, there are some limitations:
I will be looking for ways to support excluded areas, starting from βHit Countβ and combined conditions (e. g. Conditional Expression with Hit Count). Unfortunately not every breakpointβs detail is easily exposed via API but I will be extensively digging in Visual Studioβs internals to cover more use cases.
Bookmarks are stored using line numbers in a similar way to breakpoints.
Visual Studio API for bookmarks is really limited; therefore, currently there is no support for:
I hope you will enjoy using new breakpoints & bookmarks support!
The feature was one of the missing puzzle pieces, that I always wanted to include. Adding support for relative path is essential part to allow sharing your context between different dev environments and also inside your team. It will unlock potential to e. g.:
Every time a new snapshot is created it will include RelativePath
property for every entry in a *.ck
file. When a snapshot is restored, relative paths will be used by default. There is still FilePath
property used, as a fallback strategy, for global files. All different types of files are supported including:
There can be multiple tab groups opened at once and single document selected in each:
The state of both selected documents is now preserved using IsSelected
JSON property.
Additionally, support for the active tab was added. When a document has focus while generating the snapshot, it will be tagged internally using IsActive
property.
There are two additional commands in the toolbar. Stash and unstash. The idea is from git workflow but here it's applied to a current context you're working on. You could quickly save it (stash) and switch to something else that needs an urgent attention. After stashing a snapshot all tabs will be closed automatically, similarly how stashing works in git - current context is cleared and ready for a new work.
A stash snapshot is always displayed as a first on the list. Currently only single stash is supported but multiple stashes will be supported in the future.
A stash has additional description, like "
You could assign your favorites keyboard shortcut combination for stash and unstash commands from the toolbar. There aren't default shortcuts assigned but I found useful to use:
There is a support added to remember if windows is maximized during snapshot creation. No more problems with restoring maximized windows, especially during git branch switching π Only maximized windows will have additional property serialized in a snapshot.
All snapshots are stored in the .contextkeeper folder which is created in the same folder where solution file (.sln) sits. A snapshot is saved using self explanatory JSON format. You could try changing different bits manually and later checking an impact it has during restoring process.
The git worktree support, introduced in v1.3, allows even more streamlined context switching. If you sometimes clone entire repository when working on a feature I recommend checking git worktree. Long story short, working tree is like clean, cloned repository but better because:
Below, you'll find a table comparing extensions that work with VS 2022. I've included free extensions, with the exception of Task Canvas, which is a paid one. I've invested several hours testing Favorite Documents, Workspace Manager, and Task Canvas to get a clearer picture of how they all stack up against ContextKeeper.
Features supported | ContextKeeper | Task Canvas | Favorite Documents | Workspace Manager |
---|---|---|---|---|
Automatic session switching when changing Git branches | β | β | β | β |
Restores full Visual Studio's original documents state | β | β | β | β |
Tabs order | β | β | β | unreliable |
Tab groups (including horizontal/vertical orientation) | β | β | β | unreliable |
Document windows positions & size (including floating windows) | β | β | β | unreliable |
Breakpoints | β | β | β | β |
Bookmarks | β | β | β | β |
Last selected tab for every window | β | β | β | unreliable |
Last active tab among all opened | β | β | β | unreliable |
Visual Studio independent restore engine | β | partially | β | β |
Multiple document windows | β | β | β | unreliable |
Multiple monitors support | β | β | β | unreliable |
Relative path (portable sessions between environments) | β | limited | limited | β |
Maximized/Normal state for document windows | β | β | β | β |
Source control ready sessions files (diffable JSON format) | β | β | β | β |
Continuous session auto-save for branch snapshots | β | β | β | β |
One-click append files | β | β | β | β |
Pinned files | β | β | β | unreliable |
One-click session update | β | β | β(only adding) | unreliable |
One-click restore | β | β | β | β |
Shareable session's file between teammates | β | β | β(one file for all sessions) | β |
Last opened files | β | β | β | unreliable |
Line & column for every file | β | β | β | unreliable |
Non-solution (external) files | β | β | β | β |
Not based on the (broken) IVsUIShellDocumentWindowMgr | β | β | β | β |
Still in an active development (updates in 2023) | β | β | β | β |
Price | Free during Beta | $49 | Free | Free |
I must say, I'm a bit surprised by how Task Canvas, the only paid competitor, performed in the comparison. It was built with a different workflow in mind, which is why it lacks in certain areas. However, it's still quite powerful and presents an interesting concept with its independent task canvas (separate, physical tab). Kudos to Sergey for trying something different. I'll take a closer look to see if there are any elements from this concept that could add additional value to ContextKeeper. What are your thoughts on this?
It appears that the most popular extension is based on the simple VS API - VsShellUtilities.OpenDocument()
. Unfortunately, it lacks more sophisticated use cases. Nonetheless, it's still better than relying solely on Visual Studio's default state engine and the inherently flawed .suo
file.
The spiritual successor to the (broken) approach of Save All the Tabs, utilizing the IVsUIShellDocumentWindowMgr.ReopenDocumentWindows()
API. Unfortunately it is nothing more than wrapper for the default Visual Studio state engine, which which has had persistent, unresolved issues for years. It's unreliable, sometimes functioning properly but often failing. My experience with it has been similar to Save All the Tabs, which I tried using with mixed success in the past.
The fail of the Save All the Tabs extension, to deliver a stable and reliable restore mechanism, really push me to work on the a truly independent session restore engine. I distinctly recall my thought process during that time -
If it doesn't work, I'll at least give it a shot and try to build it. There's nothing wrong with failing, but if I succeed, it will be a big deal one day! I will try to make it the state-of-the-art session manager that Visual Studio has never had but always deserved.
Later, the context engine has become the heart of ContextKeeper. It was entirely written from scratch, and it is fully independent from Visual Studio session restore API. It is rock solid, and works in VS 2022, including olders versions VS 2019/2017/2015. It has taken thousands of hours and years of work to bring it to a state where it is a true pleasure and an enjoyable experience to use, and to have the session manager that Visual Studio has always deserved. π Cause there ain't room for more than one King π in this town.
The Roadmap includes among others: