[Run][New Plugin] VSCode Workspaces/Remote machines (#9050)

* vscode workspaces plugin for Powertoys Run

* reduce score

* make vscode workspaces dynamic instead of string to prevent exceptions

* change icons again

* remove unused images and PreserveNewest during build

* code refactoring

* show vscode ssh remote machines

* update score workspaces

* vscode workspaces plugin for Powertoys Run

* remove unused images and PreserveNewest during build

* code refactoring

* remove unused packages

* get ExecutablePath from AppData and use shell to vscode process

* ' instead of \"

* try using ((char)34) instead of '

* add comments

* translate windows paths

* remove unused code

* add vscodeworkspace to installer

* use the new naming convention for plugins

* sign VSCodeWorkspaces.dll

* reimplement ssh-config parser

* update spell-check

* use the new naming convention for community plugins

* minor adjustments

* add actionKeyword {

* prevent copyright

* add localization

* add github link

* bug fix after localization

* --new-window --enable-proposed-api ms-vscode-remote.remote-ssh

* change order by

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Properties/Resources.Designer.cs

* Update src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/Properties/Resources.resx

* Update src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/Properties/Resources.resx

* Update src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/Properties/Resources.resx

* Update src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/Properties/Resources.resx

* Update src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.VSCodeWorkspaces/Properties/Resources.resx

* fix powertoys run settings not working

* update plugin description

Co-authored-by: ricar <ricar@ASUS>
Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
This commit is contained in:
ricardosantos9521
2021-03-04 17:15:49 +00:00
committed by GitHub
parent f648ac44b2
commit 7e5fb876bb
25 changed files with 1153 additions and 5 deletions

View File

@@ -0,0 +1,39 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.SshConfigParser
{
public class SshConfig
{
private static readonly Regex SSH_CONFIG = new Regex(@"^(\w[\s\S]*?\w)$(?=(?:\s+^\w|\z))", RegexOptions.Multiline);
private static readonly Regex KEY_VALUE = new Regex(@"(\w+\s\S+)", RegexOptions.Multiline);
public static IEnumerable<SshHost> ParseFile(string path)
{
return Parse(File.ReadAllText(path));
}
public static IEnumerable<SshHost> Parse(string str)
{
str = str.Replace("\r", "");
var list = new List<SshHost>();
foreach (Match match in SSH_CONFIG.Matches(str))
{
var sshHost = new SshHost();
string content = match.Groups.Values.ToList()[0].Value;
foreach (Match match1 in KEY_VALUE.Matches(content))
{
var split = match1.Value.Split(" ");
var key = split[0];
var value = split[1];
sshHost.Properties[key] = value;
}
list.Add(sshHost);
}
return list;
}
}
}

View File

@@ -0,0 +1,53 @@
using System.Collections.Generic;
namespace Community.PowerToys.Run.Plugin.VSCodeWorkspaces.SshConfigParser
{
public class SshHost
{
public string IdentityFile
{
get => this[nameof(IdentityFile)]?.ToString();
set => this[nameof(IdentityFile)] = value;
}
public string Host
{
get => this[nameof(Host)]?.ToString();
set => this[nameof(Host)] = value;
}
public string HostName
{
get => this[nameof(HostName)]?.ToString();
set => this[nameof(HostName)] = value;
}
public string User {
get => this[nameof(User)]?.ToString();
set => this[nameof(User)] = value;
}
public string ForwardAgent {
get => this[nameof(ForwardAgent)]?.ToString();
set => this[nameof(ForwardAgent)] = value;
}
internal Dictionary<string, object> Properties { get; } = new Dictionary<string, object>();
public object this[string key]
{
get
{
if (Properties.TryGetValue(key, out var value))
{
return value;
}
return null;
}
set { Properties[key] = value; }
}
public IEnumerable<string> Keys => Properties.Keys;
}
}