Skip to content

PowerToys Run VS Code plugin - No results since vscode 1.118 #47445

@deybhayden

Description

@deybhayden

Microsoft PowerToys version

0.99.0

Installation method

GitHub

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. Update Visual Studio Code to 1.118.0 (commit 9b8ae15a8cf95b9bce1b590b42954530f440e816).
  2. Open a few folders/workspaces in VS Code so they appear in File → Open Recent (Ctrl+R) inside VS Code itself — confirming that VS Code does still know about them.
  3. Make sure code is on PATH (%LOCALAPPDATA%\Programs\Microsoft VS Code\bin is on user PATH in my case).
  4. In PowerToys 0.99.0, ensure PowerToys Run → Visual Studio Code Workspaces is enabled. Direct activation keyword { (default).
  5. Open PowerToys Run (Alt+Space) and type {.

✔️ Expected Behavior

The list of recently opened VS Code workspaces / folders / remote machines is shown, the same list visible in VS Code's File → Open Recent.

❌ Actual Behavior

No results at all. The plugin loads cleanly (VS Code Workspaces plugin is already initialized in the log) and the query runs (PluginManager.QueryForPlugin VS Code Workspaces. Query cost - 122 milliseconds) — it just returns zero entries. No exceptions are logged.


Root cause

VS Code 1.118.0 moved the history.recentlyOpenedPathsList storage key from StorageScope.APPLICATION to a new StorageScope.APPLICATION_SHARED introduced in:

APPLICATION_SHARED lives in a brand-new database outside the VS Code user-data dir:

%USERPROFILE%\.vscode-shared\sharedStorage\state.vscdb        (Stable)
%USERPROFILE%\.vscode-insiders-shared\sharedStorage\state.vscdb (Insiders)

(see IEnvironmentService.appSharedDataHome; configurable via --shared-data-dir).

The Community.PowerToys.Run.Plugin.VSCodeWorkspaces plugin only reads the legacy location:

https://github.com/microsoft/PowerToys/blob/v0.99.0/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/WorkspacesHelper/VSCodeWorkspacesApi.cs#L94-L107

// User/globalStorage/state.vscdb - history.recentlyOpenedPathsList - vscode v1.64 or later
var vscode_storage_db = Path.Combine(vscodeInstance.AppData, "User/globalStorage/state.vscdb");
...
sqlite_cmd.CommandText = "SELECT value FROM ItemTable WHERE key LIKE 'history.recentlyOpenedPathsList'";

In VS Code 1.118 that row no longer exists in the legacy DB, and the legacy storage.json next to it isn't where recents live anymore either, so the query returns no rows and the plugin silently produces zero results.

Verification on my machine

Querying both DBs with the same SQL the plugin uses:

%APPDATA%\Code\User\globalStorage\state.vscdb       → 0 rows for history.recentlyOpenedPathsList
%USERPROFILE%\.vscode-shared\sharedStorage\state.vscdb → 1 row, value length 149,254 bytes
                                                        (full JSON: {"entries":[{"folderUri":"...","label":"...","remoteAuthority":"..."}, ...]})

VS Code's own main log even points at the new location (%APPDATA%\Code\logs\<timestamp>\main.log):

[shared storage] Creating shared storage database at
  'C:\Users\<user>\.vscode-shared\sharedStorage\state.vscdb' (wasCreated: false)
[shared storage] Initializing fallback application storage (type: local,
  path: C:\Users\<user>\AppData\Roaming\Code\User\globalStorage\state.vscdb)

I checked the 199 state.vscdb files under %APPDATA%\Code (globalStorage, profiles*, workspaceStorage*, plus .backup siblings) — none contain history.recentlyOpenedPathsList. The key is exclusively in the shared DB now.

Suggested fix

In Community.PowerToys.Run.Plugin.VSCodeWorkspaces:

  1. In VSCodeWorkspacesApi.Workspaces, in addition to probing
    Path.Combine(vscodeInstance.AppData, "User/globalStorage/state.vscdb"),
    also probe the new shared-storage path derived from the VS Code variant:

    Variant Shared DB path
    Code (Stable) %USERPROFILE%\.vscode-shared\sharedStorage\state.vscdb
    Code - Insiders %USERPROFILE%\.vscode-insiders-shared\sharedStorage\state.vscdb
    Code - Exploration %USERPROFILE%\.vscode-exploration-shared\sharedStorage\state.vscdb
    VSCodium %USERPROFILE%\.vscodium-shared\sharedStorage\state.vscdb
    VSCodium - Insiders %USERPROFILE%\.vscodium-insiders-shared\sharedStorage\state.vscdb

    For portable installs, this corresponds to <install>\data-shared\sharedStorage\state.vscdb (mirroring the existing portable handling that already maps <install>\data\user-data → AppData).

  2. The shared DB schema is identical (ItemTable(key,value) with the same JSON payload under the same key), so GetWorkspacesInVscdb works as-is once pointed at the new file.

  3. One small caveat: the shared DB is opened by VS Code in WAL mode for cross-process access, so the plugin should keep using Mode=ReadOnly in its connection string (it already does), which is fine alongside an active VS Code instance.

Workaround (for anyone else hitting this)

Until the plugin is updated, the recents data can be mirrored back into the legacy DB so the plugin sees it. A small PowerShell snippet that reads the row from the shared DB and writes it into %APPDATA%\Code\User\globalStorage\state.vscdb (run on a schedule / on VS Code exit) is sufficient.

Additional Information

  • OS: Windows 11 Pro 24H2 (build 26200)
  • Architecture: x64
  • .NET: 9.0.14 desktop runtime present (host SDK 9.0.312)
  • System Language: en-US
  • User installation (per-user MSI from GitHub release PowerToysUserSetup-0.99.0-x64.exe, install location %LOCALAPPDATA%\PowerToys\)
  • Running as admin: No
  • Plugin DLL: Community.PowerToys.Run.Plugin.VSCodeWorkspaces.dll 0.99.0.0 (bundled with PowerToys 0.99.0)
  • plugin.json reports "Version": "1.2.0", "Author": "ricardosantos9521", ID 525995402BEF4A8CA860D92F6D108092

Other Software

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions