fix: correct the VSCodium shared storage path - #30
Merged
Conversation
VSCodium's shared storage lives in ~/.vscode-oss-shared, not ~/.vscodium-shared. The directory name comes from the `sharedDataFolderName` key in product.json, which is a separate key from `dataFolderName` and is not derived from the product name. VSCodium rebrands `dataFolderName` and `serverDataFolderName` but inherits `sharedDataFolderName` unchanged from Code - OSS. Since ~/.vscodium-shared never exists, resolve() fell through to the legacy path that VSCode 1.118 migrated away from, so the runner returned no matches at all for VSCodium users.
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.
Summary
DatabaseFilePath.codiumSharedpoints at~/.vscodium-shared/sharedStorage/state.vscdb.No VS Code build produces that directory. VSCodium's shared storage lives in
~/.vscode-oss-shared/sharedStorage/state.vscdb.Because the path never exists,
resolve()falls through to the legacy~/.config/VSCodium/User/globalStorage/state.vscdb, which VS Code 1.118 has alreadymigrated away from. The runner starts, registers on D-Bus and answers
Match()normally —it just never finds anything. PR #26 fixed issue #25 for Stable and Insiders, but is a
no-op for VSCodium.
Symptom
The key is genuinely gone from the legacy database — only a migration breadcrumb is left,
while the live data sits at the
sharedDataFolderNamelocation:Reproduction
busctl --user call codes.merritt.vscode_runner /vscode_runner org.kde.krunner1 Match s "<project>"->
a(sssida{sv}) 0.sqlite3 ~/.vscode-oss-shared/sharedStorage/state.vscdb "SELECT length(value) FROM ItemTable WHERE key='history.recentlyOpenedPathsList';"-> non-zero, proving the data exists.
What VS Code actually reads
The directory name is not
dataFolderNamewith a-sharedsuffix. It comes from aseparate
product.jsonkey,sharedDataFolderName:sharedDataFolderNameis a required field on the product definition, declared next to butindependent of
dataFolderName. Permalinks pinned tomicrosoft/vscode@849be60e:environmentService.ts#L150-L163,storageMainService.ts#L203,product.ts#L120-L121.The suffix rule is an easy assumption to make, and it is documented that way upstream:
microsoft/vscode#311317, the PR that
introduced this storage, describes the location as
~/<dataFolderName>-shared/sharedStorage/state.vscdb. That description holds forMicrosoft's own builds, where
sharedDataFolderNamedoes equaldataFolderName+-shared. It does not hold for rebranded forks.Folder names per build
dataFolderNamesharedDataFolderName.vscode-oss.vscode-oss-sharedproduct.json#L6.vscode-oss(not rebranded).vscode-oss-shared(inherited)prepare_vscode.sh#L96-L121— 26setpathcalls, neitherdataFolderNamenorsharedDataFolderNameamong them.vscodium-insiders(rebranded).vscode-oss-shared(inherited)prepare_vscode.sh#L68-L94— 27setpathcalls, includingdataFolderName(L71) andserverDataFolderName(L76), but notsharedDataFolderName.vscode-insiders.vscode-insiders-sharedproduct.ts#L121doc comment.vscode.vscode-shared<dataFolderName>-sharedper themicrosoft/vscode#311317description; Microsoft's brandedproduct.jsonis generated at build time and is not in the public repoThe VSCodium Insiders row is the one that breaks the suffix rule outright:
dataFolderNameis rebranded,
sharedDataFolderNameis not.prepare_vscode.shcontains zero occurrencesof
sharedDataFolderNamein the whole file, so both VSCodium qualities inherit theCode - OSS value and share a single shared-storage directory — there is no separate
Insiders path to add here.
Confirmed against a shipped build:
The change
codiumSharednow points at.vscode-oss-shared..vscodium-sharedis removed ratherthan demoted to a fallback, since no build has ever produced it. Stable and Insiders are
untouched, so the fix from PR #26 cannot regress.
With this applied,
DatabaseFilePath.resolve(VSCodeVersion.codium)returns~/.vscode-oss-shared/sharedStorage/state.vscdband the runner matches again.Not covered by this PR
All pre-existing, and all affect every variant rather than just VSCodium:
--shared-data-diroverrides the directory entirely.VSCODE_PORTABLEredirects it to<portable>/shared-data/sharedStorage/state.vscdb(note
shared-data, notsharedStorage's usual parent).sharedDataFolderNamefrom the installedproduct.jsonwould be correct byconstruction and is what other consumers of this database do — see Raycast's
visual-studio-code-recent-projectsand yasb.
The cost is locating the install directory, which varies across
/opt,/usr/share,/usr/lib, Flatpak, Snap and AppImage; on Arch thecodiumentry inPATHis a shellwrapper that execs another wrapper, so it cannot be walked to
resources/app/product.jsongenerically.resolve()logs nothing when every candidate misses. A line listing the paths that werechecked would have made this class of bug diagnosable from a journal paste alone.
Happy to follow up on any of these separately.
Environment
vscodium-bin, Arch Linux)Related
microsoft/PowerToys#47505 — the same
bug in another consumer of this database.