fix(vscode): vscode state database path detection to support shared storage#894
Open
BrainlessDip wants to merge 1 commit intoamnweb:mainfrom
Open
fix(vscode): vscode state database path detection to support shared storage#894BrainlessDip wants to merge 1 commit intoamnweb:mainfrom
BrainlessDip wants to merge 1 commit intoamnweb:mainfrom
Conversation
…torage Extract VSCode state database path resolution into a dedicated utility function to support both standard and shared storage configurations. Add automatic detection of VSCode installation via product.json to determine the correct sharedDataFolderName, falling back to the default APPDATA location when shared storage is not configured or detection fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issues caused by VS Code 1.118+ moving
history.recentlyOpenedPathsListfrom global storage to shared storage.This change introduces a new utility to dynamically resolve the correct
state.vscdbpath instead of relying on a hardcoded location.What was done
Added
get_state_db_path()helper to determine the correct database path at runtimeImplemented detection of shared storage by:
product.jsonfrom the latest VS Code installationsharedDataFolderNameto resolve the shared storage directory~/<sharedDataFolderName>/sharedStorage/state.vscdbAdded existence checks to ensure the shared DB is actually available before using it
Implemented fallback to legacy global storage:
%APPDATA%\Code\User\globalStorage\state.vscdbAdded
find_vscode_product_json()to safely locate the correctproduct.jsonfrom installed versionsRefactors
Replaced all hardcoded global storage paths with
get_state_db_path()in:VSCodeProviderThis approach avoids hardcoding
.vscode-sharedand instead adapts based on the user’s actual environment, making it future-proof and more reliable.