fix: No recent entries in current vscode versions#2
Conversation
The storage location of the state.vscdb has changed in recent vscode versions. This commit uses the new location with a fallback to the legacy one.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the plugin’s VS Code state database discovery to support the newer shared storage location introduced in recent VS Code versions.
Changes:
- Add a “shared storage”
state.vscdbpath and keep the legacy path as a fallback. - Select the effective
_stateDBPathbased on whether the shared DB exists.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ".config/Code/User/globalStorage/state.vscdb" | ||
| ) | ||
|
|
||
| _stateDBPath = _sharedStateDBPath if os.path.exists(_sharedStateDBPath) else _legacyStateDBPath |
|
@Sharsie can cou take a look? (auto assignment didnt work) |
| # VSCode 1.118+ moved this to a shared storage location | ||
| _sharedStateDBPath = os.path.join( | ||
| os.environ["HOME"], | ||
| ".vscode-shared/sharedStorage/state.vscdb" |
There was a problem hiding this comment.
Looking at vscode sources, there seem to be a bunch of storage locations that should be considered?
I'm not running 118 yet, but I can check after upgrading. I assume that the user db is going to be at .vscode/... and we may actually want to query both databases.
There are also profile databases, but that should probably be ignored, at least for now.
The storage location of the state.vscdb has changed in recent vscode versions. This PR uses the new location with a fallback to the legacy one.