Search code examples
visual-studio-codevscode-extensionsvscode-remote

context.storagePath is empty (except meta.json) but cached data is still available while debugging [REMOTE SSH]


I do have a really spooky issue while debugging my extension. Since I am using the workspaceState to cache information I tried to figure out where the state is usually located.

ExtensionContext.storagePath result into a path I was expecting /home/<user>/.vscode-server/data/User/workspaceStorage/a002010c26b7b33d865d62202553fe33/myname.myextension

This folder only contain a meta.json. (no other hidden files or folders)

But the strange thing is, that still the cached data is available. Any ideas where else this can be located?

I already removed the whole ".vscode-server" directory and still cached data is being loaded from somewhere else!?


Solution

  • I found it out by myself. The cached data is stored on my local machine (not the remote connected computer).

    So even if the ExtensionContext.storagePath is refering to a local path on the remote. It may happen that cached data is stored locally.

    In my case it is a windows machine and the storagePath was:

    C:\Users\<user>\AppData\Roaming\Code\User\workspaceStorage\a002010c26b7b33d865d62202553fe33

    I assume this may also have something to do with its ExtensionKind