Skip to content

Commit 719ec64

Browse files
committed
Fix #13: support VSCODE_APPDATA environment variable
1 parent 7832524 commit 719ec64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WorkspaceLauncherForVSCode/Services/VisualStudioCodeInstanceProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ private static void LoadInstances(VisualStudioCodeEdition enabledEditions, List<
3636
{
3737
var appdataProgramFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
3838
var programsFolderPathBase = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
39-
var defaultStoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Code", "User", "globalStorage");
40-
var insiderStoragePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Code - Insiders", "User", "globalStorage");
39+
var appDataBasePath = Environment.GetEnvironmentVariable("VSCODE_APPDATA") ?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
40+
var defaultStoragePath = Path.Combine(appDataBasePath, "Code", "User", "globalStorage");
41+
var insiderStoragePath = Path.Combine(appDataBasePath, "Code - Insiders", "User", "globalStorage");
4142

4243
if (enabledEditions.HasFlag(VisualStudioCodeEdition.Default))
4344
{

0 commit comments

Comments
 (0)