Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RemoteDebuggerLauncherExtension.sln.GhostDoc.user.dic
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ nuget
Offroad
omnisharp
openssh
Passphrase
pkgdef
plugin
powershell
Expand All @@ -57,6 +58,7 @@ stdout
sudo
Thumbprint
typeof
Unadvise
uname
unconfigured
Username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@

using System;
using System.ComponentModel.Design;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using RemoteDebuggerLauncher.RemoteOperations;
using RemoteDebuggerLauncher.WebTools;

namespace RemoteDebuggerLauncher
Expand All @@ -25,9 +21,6 @@ internal sealed class SetupHttpsCommand
/// <summary>Command ID.</summary>
public const int CommandId = 0x0105;

/// <summary>VS Package that provides this command, not null.</summary>
public static readonly Guid CommandSet = new Guid("67dde3fd-abea-469b-939f-02a3178c91e7");

/// <summary>
/// VS Package that provides this command, not null.
/// </summary>
Expand Down
30 changes: 17 additions & 13 deletions src/Extension/RemoteDebuggerLauncher/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@
using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Design", "CA1068:CancellationToken parameters must come last", Justification = "Signature given by VS Package", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteDebuggerLauncherPackage.CreateServiceAsync(Microsoft.VisualStudio.Shell.IAsyncServiceContainer,System.Threading.CancellationToken,System.Type)~System.Threading.Tasks.Task{System.Object}")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Type")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Console")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Version")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Request")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "required in order to safely ignore errors", Scope = "member", Target = "~P:RemoteDebuggerLauncher.WebTools.ConfiguredWebProject.WebRoot")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "required in order to safely ignore errors", Scope = "member", Target = "~M:RemoteDebuggerLauncher.WebTools.StaticWebAssetsCollectorService.LoadStaticAssetsAsync~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Dotnet.GetInstallDotnetShUrl")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Dotnet.GetInstallDotnetPs1Url")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Debugger.GetVsDbgPs1Url")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Debugger.GetVsDbgShUrl")]
[assembly: SuppressMessage("Major Code Smell", "S3881:\"IDisposable\" should be implemented correctly", Justification = "Dispose used to control the lifetime of the instance only.", Scope = "type", Target = "~T:RemoteDebuggerLauncher.WaitDialogService")]
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "By design, is a well-known term", Scope = "type", Target = "~T:RemoteDebuggerLauncher.PackageConstants.CPS")]
[assembly: SuppressMessage("Minor Code Smell", "S3267:Loops should be simplified with \"LINQ\" expressions", Justification = "By design", Scope = "member", Target = "~M:RemoteDebuggerLauncher.DotnetPublishService.SupportsFrameworkDependentAsync~System.Threading.Tasks.Task{System.Boolean}")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Required to not crash the process on an exception", Scope = "member", Target = "~M:RemoteDebuggerLauncher.DotnetPublishService.StartAsync~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "By design to ignore all failures", Scope = "member", Target = "~M:RemoteDebuggerLauncher.WebTools.CertificateService.DisposeCertificates(System.Security.Cryptography.X509Certificates.X509Certificate2Collection)")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "By design to ignore all failures", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncDirectorySessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "By design to ignore all failures", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncFileSessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Type")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Console")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Version")]
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Needs to be an instance property", Scope = "member", Target = "~P:RemoteDebuggerLauncher.AdapterLaunchConfiguration.LaunchConfiguration.Request")]
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.DotnetPublishService.StartAsync~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellSessionService.UploadFolderRecursiveAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellSessionService.UploadFileAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
Expand All @@ -37,5 +32,14 @@
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellCopyProgressReporter.OnUploadFile(System.Object,Renci.SshNet.Common.ScpUploadEventArgs)")]
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncDirectorySessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "False positive", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncFileSessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "By design to ignore all failures", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncDirectorySessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "By design to ignore all failures", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellRemoteBulkCopyRsyncSessionService.StartRsyncFileSessionAsync(System.String,System.String,RemoteDebuggerLauncher.IOutputPaneWriterService)~System.Threading.Tasks.Task")]
[assembly: SuppressMessage("Naming", "CA1713:Events should not have 'Before' or 'After' prefix", Justification = "Keep consistent with VS event sink", Scope = "member", Target = "~E:RemoteDebuggerLauncher.VsSolutionEventsListener.AfterCloseSolution")]
[assembly: SuppressMessage("Naming", "CA1713:Events should not have 'Before' or 'After' prefix", Justification = "Keep consistent with VS event sink", Scope = "member", Target = "~E:RemoteDebuggerLauncher.IVsSolutionEventsFacade.AfterCloseSolution")]
[assembly: SuppressMessage("Major Code Smell", "S1168:Empty arrays and collections should be returned instead of null", Justification = "To prevent unneeded allocations", Scope = "member", Target = "~M:RemoteDebuggerLauncher.RemoteOperations.SecureShellKeyPassphraseService.EncryptPassphrase(System.String)~System.Byte[]")]
[assembly: SuppressMessage("Major Code Smell", "S3881:\"IDisposable\" should be implemented correctly", Justification = "No need", Scope = "type", Target = "~T:RemoteDebuggerLauncher.VsSolutionEventsListener")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Dotnet.GetInstallDotnetShUrl")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Dotnet.GetInstallDotnetPs1Url")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Debugger.GetVsDbgPs1Url")]
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hard coded", Justification = "By design, is a well-known URL", Scope = "member", Target = "~F:RemoteDebuggerLauncher.PackageConstants.Debugger.GetVsDbgShUrl")]
[assembly: SuppressMessage("Major Code Smell", "S3881:\"IDisposable\" should be implemented correctly", Justification = "Dispose used to control the lifetime of the instance only.", Scope = "type", Target = "~T:RemoteDebuggerLauncher.WaitDialogService")]
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "By design, is a well-known term", Scope = "type", Target = "~T:RemoteDebuggerLauncher.PackageConstants.CPS")]
[assembly: SuppressMessage("Minor Code Smell", "S3267:Loops should be simplified with \"LINQ\" expressions", Justification = "By design", Scope = "member", Target = "~M:RemoteDebuggerLauncher.DotnetPublishService.SupportsFrameworkDependentAsync~System.Threading.Tasks.Task{System.Boolean}")]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Debug;
using Microsoft.VisualStudio.Shell;
using RemoteDebuggerLauncher.RemoteOperations;

namespace RemoteDebuggerLauncher
{
Expand All @@ -25,8 +26,8 @@ internal sealed class ConfiguredPackageServiceFactory : PackageServiceFactory, I
private readonly IDebugTokenReplacer tokenReplacer;

[ImportingConstructor]
public ConfiguredPackageServiceFactory(SVsServiceProvider asyncServiceProvider, IVsFacadeFactory facadeFactory, IDebugTokenReplacer tokenReplacer, ConfiguredProject configuredProject) :
base (asyncServiceProvider, facadeFactory, configuredProject)
public ConfiguredPackageServiceFactory(SVsServiceProvider asyncServiceProvider, IVsFacadeFactory facadeFactory, IDebugTokenReplacer tokenReplacer, ConfiguredProject configuredProject, ISecureShellKeyPassphraseService passphraseService) :
base (asyncServiceProvider, facadeFactory, configuredProject, passphraseService)
{
this.tokenReplacer = tokenReplacer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ internal class PackageServiceFactory : IPackageServiceFactory
private ConfigurationAggregator configurationAggregator;
private ConfiguredProject configuredProject;
private IOutputPaneWriterService outputPaneWriter;
private readonly ISecureShellKeyPassphraseService passphraseService;

protected PackageServiceFactory(SVsServiceProvider asyncServiceProvider, IVsFacadeFactory facadeFactory, ConfiguredProject configuredProject)
protected PackageServiceFactory(SVsServiceProvider asyncServiceProvider, IVsFacadeFactory facadeFactory, ConfiguredProject configuredProject, ISecureShellKeyPassphraseService passphraseService)
{
this.asyncServiceProvider = asyncServiceProvider as IAsyncServiceProvider;
this.facadeFactory = facadeFactory;
this.configuredProject = configuredProject;
this.passphraseService = passphraseService;
}

/// <inheritdoc />
Expand Down Expand Up @@ -65,7 +67,7 @@ public async Task<ISecureShellRemoteOperationsService> GetSecureShellRemoteOpera
{
var statusbar = await GetStatusbarServiceAsync();
var settings = SecureShellSessionSettings.Create(configurationAggregator);
var sessionService = new SecureShellSessionService(settings);
var sessionService = new SecureShellSessionService(settings, passphraseService);
var bulkCopyService = CreateBulkCopyService(sessionService, configurationAggregator);
return new SecureShellRemoteOperationsService(configurationAggregator, sessionService, bulkCopyService, outputPaneWriter, statusbar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Debug;
using Microsoft.VisualStudio.Shell;
using RemoteDebuggerLauncher.RemoteOperations;

namespace RemoteDebuggerLauncher
{
Expand All @@ -26,8 +27,8 @@ internal class UnconfiguredPackageServiceFactory : PackageServiceFactory, IUncon
private readonly IDebugTokenReplacer tokenReplacer;

[ImportingConstructor]
public UnconfiguredPackageServiceFactory(SVsServiceProvider asyncServiceProvider, IDebugTokenReplacer tokenReplacer, IVsFacadeFactory facadeFactory) :
base(asyncServiceProvider, facadeFactory, null)
public UnconfiguredPackageServiceFactory(SVsServiceProvider asyncServiceProvider, IDebugTokenReplacer tokenReplacer, IVsFacadeFactory facadeFactory, ISecureShellKeyPassphraseService passphraseService) :
base(asyncServiceProvider, facadeFactory, null, passphraseService)
{
this.tokenReplacer = tokenReplacer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

using System.IO;
using Microsoft.VisualStudio.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.Debug;

namespace RemoteDebuggerLauncher
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@
<Compile Include="Infrastructure\DirectoryHelper.cs" />
<Compile Include="Infrastructure\FileHelper.cs" />
<Compile Include="RemoteOperations\IRemoteBulkCopySessionService.cs" />
<Compile Include="RemoteOperations\ISecureShellKeyPassphraseService.cs" />
<Compile Include="RemoteOperations\ISecureShellKeySetupService.cs" />
<Compile Include="RemoteOperations\ISecureShellSessionBaseService.cs" />
<Compile Include="RemoteOperations\SecureShellCopyProgress.cs" />
<Compile Include="RemoteOperations\SecureShellKeyPassphraseService.cs" />
<Compile Include="RemoteOperations\SecureShellRemoteBulkCopyDeltaSessionService.cs" />
<Compile Include="RemoteOperations\SecureShellRemoteBulkCopyRsyncSessionService.cs" />
<Compile Include="RemoteOperations\ShellStreamExtensions.cs" />
Expand All @@ -94,13 +97,14 @@
<Compile Include="ProjectSystem\UnconfiguredPackageServiceFactory.cs" />
<Compile Include="ProjectSystem\Build\SecureShellDeployService.cs" />
<Compile Include="RemoteOperations\SecureShellKeySetupSettings.cs" />
<Compile Include="RemoteOperations\ISecureShellKeySetupService.cs" />
<Compile Include="RemoteOperations\SecureShellKeyPairCreatorService.cs" />
<Compile Include="RemoteOperations\SecureShellKeySetupService.cs" />
<Compile Include="Commands\SetupHttpsCommand.cs" />
<Compile Include="VsInterop\IVsSolutionEventsFacade.cs" />
<Compile Include="VsInterop\OutputPaneTextWriterService.cs" />
<Compile Include="ProjectSystem\Build\DotnetPublishService.cs" />
<Compile Include="VsInterop\IVsSolutionFacade.cs" />
<Compile Include="VsInterop\VsSolutionEventsListener.cs" />
<Compile Include="VsInterop\VsOutputWindowPaneExtensions.cs" />
<Compile Include="VsInterop\VsInteropExtensions.cs" />
<Compile Include="VsInterop\AsyncServiceProviderExtensions.cs" />
Expand Down Expand Up @@ -323,6 +327,7 @@
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Security" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
// Add services implemented in this package
AddService(typeof(SOptionsPageAccessor), CreateServiceAsync, true);

// Register the solution event listener
var solution = (await this.GeVsFacadeFactoryAsync()).GetVsSolution();


// When initialized asynchronously, the current thread may be a background thread at this point.
// Do any initialization that requires the UI thread after switching to the UI thread.
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
Expand All @@ -70,6 +74,22 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
}
#endregion

#region IDisposable
/// <summary>
/// Dispose method to clean up resources.
/// </summary>
/// <param name="disposing">True if called from Dispose method.</param>
protected override void Dispose(bool disposing)
{
if (disposing)
{
// Clear cached passphrases for security
//RemoteOperations.SecureShellPassphraseService.Instance.ClearCache();
}
base.Dispose(disposing);
}
#endregion

#region Private Methods
/// Factory methods responsible to create service instances registered in this package.
/// </summary>
Expand Down
Loading