[PT Run][VSCodeWorkspace] Adds support for VSCode portable (#19442)

* [PT Run][VSCodeWorkspace] Adds support for VSCode portable

* Add PATH warning to the subheader
This commit is contained in:
Bruno Meneguello 2022-08-01 13:03:50 -03:00 committed by GitHub
parent b1ad9160cc
commit 65f457e9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -125,7 +125,8 @@
<comment>Used to indicate the location where something is</comment>
</data>
<data name="PluginDescription" xml:space="preserve">
<value>Opens workspaces, remote machines (SSH or Codespaces) and containers, previously opened in VS Code.</value>
<value>Opens workspaces, remote machines (SSH or Codespaces) and containers, previously opened in VS Code. The VS Code instance needs to be in PATH.</value>
<comment>VS Code is the name of a product. PATH is the name of an environment variable. Don't translate it.</comment>
</data>
<data name="SSHRemoteMachine" xml:space="preserve">
<value>SSH remote machine</value>

View File

@ -122,7 +122,9 @@ namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.VSCodeHelper
if (version != string.Empty)
{
instance.AppData = Path.Combine(_userAppDataPath, version);
var portableData = Path.Join(iconPath, "data");
instance.AppData = Directory.Exists(portableData) ? Path.Join(portableData, "user-data") : Path.Combine(_userAppDataPath, version);
var iconVSCode = Path.Join(iconPath, $"{version}.exe");
var bitmapIconVscode = Icon.ExtractAssociatedIcon(iconVSCode).ToBitmap();