From c54301a8865a06c75b4352005f26084886021c93 Mon Sep 17 00:00:00 2001 From: Tevin Stanley Date: Mon, 22 May 2023 12:21:54 -0700 Subject: [PATCH 1/2] wip for updating dependencies --- nuget.config | 6 +++++- .../Microsoft.VisualStudio.SlowCheetah.csproj | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nuget.config b/nuget.config index 70eba72..8f510d9 100644 --- a/nuget.config +++ b/nuget.config @@ -11,8 +11,9 @@ - Microsoft;xunit;aarnott;jkeech;sharwell;jamesnk + Microsoft;xunit;aarnott;jkeech;sharwell;jamesnk;Nerdbank + @@ -20,5 +21,8 @@ + + + diff --git a/src/Microsoft.VisualStudio.SlowCheetah/Microsoft.VisualStudio.SlowCheetah.csproj b/src/Microsoft.VisualStudio.SlowCheetah/Microsoft.VisualStudio.SlowCheetah.csproj index 3f5a671..5425fa4 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah/Microsoft.VisualStudio.SlowCheetah.csproj +++ b/src/Microsoft.VisualStudio.SlowCheetah/Microsoft.VisualStudio.SlowCheetah.csproj @@ -35,10 +35,10 @@ - + - - + + From a4f8959aa3b64b314c1f829607c49ce8c5870981 Mon Sep 17 00:00:00 2001 From: Tevin Stanley Date: Wed, 24 May 2023 13:25:11 -0700 Subject: [PATCH 2/2] updating old package references and fixing some easy warnings --- .../BaseTest.cs | 2 +- .../BuildTests/ConfigTransformTestsBase.cs | 30 +++++------ .../BuildTests/ConsoleAppTests.cs | 6 +-- .../BuildTests/WebAppTests.cs | 4 +- ...soft.VisualStudio.SlowCheetah.Tests.csproj | 19 +++++-- .../TransformTest.cs | 4 +- ...t.VisualStudio.SlowCheetah.VS.Tests.csproj | 19 +++++-- .../PackageUtilitiesTest.cs | 42 +++++++-------- ...crosoft.VisualStudio.SlowCheetah.VS.csproj | 15 +++--- .../BackgroundInstallationHandler.cs | 13 ++--- .../PackageHandlers/BasePackageHandler.cs | 10 ++-- .../DialogInstallationHandler.cs | 10 ++-- .../PackageHandlers/EmptyHandler.cs | 6 +-- .../PackageHandlers/IPackageHandler.cs | 12 ++--- .../PackageHandlers/NuGetUninstaller.cs | 8 +-- .../PackageHandlers/NugetInstaller.cs | 8 +-- .../PackageHandlers/TargetsUninstaller.cs | 8 +-- .../UserInstallationHandler.cs | 14 ++--- .../NugetHandler/SlowCheetahNuGetManager.cs | 24 ++++----- .../NugetHandler/VsProjectTypes.cs | 2 +- .../Options/AdvancedOptionsDialogPage.cs | 10 ++-- .../Options/AdvancedOptionsUserControl.cs | 6 +-- .../Options/BaseOptionsDialogPage.cs | 4 +- .../Options/OptionsDialogPage.cs | 12 ++--- .../Options/OptionsUserControl.cs | 6 +-- .../Package/AddTransformCommand.cs | 34 ++++++------ .../Package/BaseCommand.cs | 26 ++++----- .../Package/PackageSolutionEvents.cs | 10 ++-- .../Package/PreviewTransformCommand.cs | 28 +++++----- .../Package/SlowCheetahPackageLogger.cs | 10 ++-- .../Resources/Guids.cs | 12 ++--- .../Resources/PkgCmdID.cs | 6 +-- .../SlowCheetahPackage.cs | 20 +++---- .../TransformationPreviewLogger.cs | 6 +-- .../Utilities/PackageUtilities.cs | 46 ++++++++-------- .../Utilities/ProjectUtilities.cs | 42 +++++++-------- ...osoft.VisualStudio.SlowCheetah.Vsix.csproj | 17 +++--- .../Build/TransformTask.cs | 8 +-- .../Logging/ITransformationLogger.cs | 54 +++++++++---------- .../Logging/JsonShimLogger.cs | 4 +- .../Logging/TransformationTaskLogger.cs | 4 +- .../Logging/XmlShimLogger.cs | 6 +-- .../Transformer/ITransformer.cs | 32 +++++------ .../Transformer/JsonTransformer.cs | 6 +-- .../Transformer/TransformUtilities.cs | 2 +- .../Transformer/TransformerFactory.cs | 14 ++--- .../Transformer/XmlTransformer.cs | 6 +-- 47 files changed, 355 insertions(+), 332 deletions(-) diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BaseTest.cs b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BaseTest.cs index 11ad128..73b05ec 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BaseTest.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BaseTest.cs @@ -18,7 +18,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.Tests public class BaseTest : IDisposable { /// - /// Gets the list of temporary files to delete after test + /// Gets the list of temporary files to delete after test. /// protected IList FilesToDeleteAfterTest { get; } = new List(); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConfigTransformTestsBase.cs b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConfigTransformTestsBase.cs index 79a87ba..e35e2ff 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConfigTransformTestsBase.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConfigTransformTestsBase.cs @@ -21,7 +21,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.Tests.BuildTests public abstract class ConfigTransformTestsBase : IDisposable { /// - /// Gets the test solution directory + /// Gets the test solution directory. /// public string SolutionDir { @@ -29,7 +29,7 @@ public string SolutionDir } /// - /// Gets the output path of the test project + /// Gets the output path of the test project. /// public string OutputPath { @@ -37,7 +37,7 @@ public string OutputPath } /// - /// Gets the test projects directory + /// Gets the test projects directory. /// public string TestProjectsDir { @@ -45,7 +45,7 @@ public string TestProjectsDir } /// - /// Gets the msbuild exe path that was cached during build + /// Gets the msbuild exe path that was cached during build. /// private static string MSBuildExePath { @@ -57,10 +57,10 @@ private static string MSBuildExePath } /// - /// Builds the project of the given name from the + /// Builds the project of the given name from the . /// /// Name of the project to be built. - /// Must correspond to a folder name in the test projects directory + /// Must correspond to a folder name in the test projects directory. public void BuildProject(string projectName) { var globalProperties = new Dictionary() @@ -93,11 +93,11 @@ public void BuildProject(string projectName) } /// - /// Gets a app setting from a configuration file + /// Gets a app setting from a configuration file. /// - /// Path to the configuration file - /// Setting key - /// Value of the setting + /// Path to the configuration file. + /// Setting key. + /// Value of the setting. public string GetAppSettingValue(string configFilePath, string appSettingKey) { var configFile = XDocument.Load(configFilePath); @@ -108,11 +108,11 @@ where settingEl.Attribute("key").Value == appSettingKey } /// - /// Gets the value of a node within a configuration file + /// Gets the value of a node within a configuration file. /// - /// Path to the configuration file - /// Name of the node - /// Value of the node + /// Path to the configuration file. + /// Name of the node. + /// Value of the node. public string GetConfigNodeValue(string configFilePath, string nodeName) { var configFile = XDocument.Load(configFilePath); @@ -120,7 +120,7 @@ public string GetConfigNodeValue(string configFilePath, string nodeName) } /// - /// At the end of tests, delete the output path for the tested projects + /// At the end of tests, delete the output path for the tested projects. /// public void Dispose() { diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConsoleAppTests.cs b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConsoleAppTests.cs index c3a57c9..9261002 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConsoleAppTests.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/ConsoleAppTests.cs @@ -12,13 +12,13 @@ namespace Microsoft.VisualStudio.SlowCheetah.Tests.BuildTests using Xunit; /// - /// Tests build time transformations for a test console app + /// Tests build time transformations for a test console app. /// [Collection("BuildTests")] public class ConsoleAppTests : ConfigTransformTestsBase { /// - /// Tests if app.config is transformed on build + /// Tests if app.config is transformed on build. /// [Fact] public void ConsoleApp_AppConfig_IsTransformed() @@ -34,7 +34,7 @@ public void ConsoleApp_AppConfig_IsTransformed() } /// - /// Tests if other.config is transformed on build + /// Tests if other.config is transformed on build. /// [Fact] public void ConsoleApp_OtherConfig_IsTransformed() diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/WebAppTests.cs b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/WebAppTests.cs index ff82343..b2baef5 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/WebAppTests.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/BuildTests/WebAppTests.cs @@ -12,13 +12,13 @@ namespace Microsoft.VisualStudio.SlowCheetah.Tests.BuildTests using Xunit; /// - /// Tests build time transformations for a test web app + /// Tests build time transformations for a test web app. /// [Collection("BuildTests")] public class WebAppTests : ConfigTransformTestsBase { /// - /// Tests if other.config is transformed on build + /// Tests if other.config is transformed on build. /// [Fact] public void WebApp_OtherConfig_IsTransformed() diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/Microsoft.VisualStudio.SlowCheetah.Tests.csproj b/src/Microsoft.VisualStudio.SlowCheetah.Tests/Microsoft.VisualStudio.SlowCheetah.Tests.csproj index 58434a5..093b52e 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/Microsoft.VisualStudio.SlowCheetah.Tests.csproj +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/Microsoft.VisualStudio.SlowCheetah.Tests.csproj @@ -13,11 +13,20 @@ - - - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Tests/TransformTest.cs b/src/Microsoft.VisualStudio.SlowCheetah.Tests/TransformTest.cs index 4170ec8..85f8823 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Tests/TransformTest.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.Tests/TransformTest.cs @@ -12,12 +12,12 @@ namespace Microsoft.VisualStudio.SlowCheetah.Tests using Xunit; /// - /// Tests for + /// Tests for . /// public class TransformTest : BaseTest { /// - /// Tests for + /// Tests for . /// [Fact] public void TestXmlTransform() diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/Microsoft.VisualStudio.SlowCheetah.VS.Tests.csproj b/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/Microsoft.VisualStudio.SlowCheetah.VS.Tests.csproj index 4ff953d..43b54b1 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/Microsoft.VisualStudio.SlowCheetah.VS.Tests.csproj +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/Microsoft.VisualStudio.SlowCheetah.VS.Tests.csproj @@ -7,11 +7,20 @@ - - - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/PackageUtilitiesTest.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/PackageUtilitiesTest.cs index 9f152e5..f21779f 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/PackageUtilitiesTest.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS.Tests/PackageUtilitiesTest.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS.Tests using Xunit; /// - /// Test class for + /// Test class for . /// public class PackageUtilitiesTest { @@ -15,10 +15,10 @@ public class PackageUtilitiesTest private IEnumerable testProjectConfigsWithDots = new List(new string[] { "Debug", "Debug.Test", "Release", "Test.Release", "Test.Rel" }); /// - /// Tests returns on arguments that are null or empty strings + /// Tests returns on arguments that are null or empty strings. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData(null, null)] [InlineData("", "")] @@ -34,8 +34,8 @@ public void IsFileTransformWithNullArguments(string docName, string trnName) /// /// Tests with valid arguments normally found in projects. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.Debug.config")] [InlineData("App.config", "app.release.config")] @@ -47,10 +47,10 @@ public void IsFileTransformWithValidArguments(string docName, string trnName) } /// - /// Tests with invalid arguments + /// Tests with invalid arguments. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.Test.Debug.config")] [InlineData("App.Debug.config", "App.Debug.config")] @@ -62,10 +62,10 @@ public void IsFileTransformWithInvalidArguments(string docName, string trnName) /// /// Tests with project configurations containing dots - /// and file names with similar structures. Tests valid names + /// and file names with similar structures. Tests valid names. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.Debug.Test.config")] [InlineData("App.System.config", "App.System.Debug.Test.config")] @@ -80,10 +80,10 @@ public void IsFileTransformWithDottedConfigsAndValidNames(string docName, string /// /// Tests with project configurations containing dots - /// and file names with similar structures. Tests invalid names + /// and file names with similar structures. Tests invalid names. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.Release.Test.config")] [InlineData("App.config", "App.Rel.Test.config")] @@ -98,10 +98,10 @@ public void IsFileTransformWithDottedConfigsAndInvalidNames(string docName, stri } /// - /// Tests with invalid arguments + /// Tests with invalid arguments. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.config")] [InlineData("App.Debug.config", "App.Debug.config")] @@ -114,10 +114,10 @@ public void IsFileGenericTransformWithInvalidArguments(string docName, string tr } /// - /// Tests with valid arguments + /// Tests with valid arguments. /// - /// Document name - /// Transform file name + /// Document name. + /// Transform file name. [Theory] [InlineData("App.config", "App.Debug.config")] [InlineData("App.config", "App.Test.Debug.config")] diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Microsoft.VisualStudio.SlowCheetah.VS.csproj b/src/Microsoft.VisualStudio.SlowCheetah.VS/Microsoft.VisualStudio.SlowCheetah.VS.csproj index 3e26cf8..1a304e9 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Microsoft.VisualStudio.SlowCheetah.VS.csproj +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Microsoft.VisualStudio.SlowCheetah.VS.csproj @@ -9,16 +9,19 @@ - + - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BackgroundInstallationHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BackgroundInstallationHandler.cs index a3c7dde..d56e52d 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BackgroundInstallationHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BackgroundInstallationHandler.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Performs installation operations in the background + /// Performs installation operations in the background. /// internal class BackgroundInstallationHandler : UserInstallationHandler { @@ -23,20 +23,21 @@ internal class BackgroundInstallationHandler : UserInstallationHandler /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public BackgroundInstallationHandler(IPackageHandler successor) : base(successor) { } /// - /// Gets or sets a value indicating whether the operation is an update or a new installation + /// Gets or sets a value indicating whether the operation is an update or a new installation. /// public bool IsUpdate { get; set; } = false; /// - public override async TPL.Task Execute(Project project) + public override async TPL.Task ExecuteAsync(Project project) { + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); string projName = project.UniqueName; bool needInstall = true; lock (SyncObject) @@ -48,7 +49,7 @@ public override async TPL.Task Execute(Project project) { string warningTitle = this.IsUpdate ? Resources.Resources.NugetUpdate_Title : Resources.Resources.NugetInstall_Title; string warningMessage = this.IsUpdate ? Resources.Resources.NugetUpdate_Text : Resources.Resources.NugetInstall_Text; - if (await this.HasUserAcceptedWarningMessage(warningTitle, warningMessage)) + if (await this.HasUserAcceptedWarningMessageAsync(warningTitle, warningMessage)) { // Gets the general output pane to inform user of installation IVsOutputWindowPane outputWindow = (IVsOutputWindowPane)await this.Package.GetServiceAsync(typeof(SVsGeneralOutputWindowPane)); @@ -61,7 +62,7 @@ public override async TPL.Task Execute(Project project) string outputMessage = Resources.Resources.NugetInstall_FinishedOutput; try { - await this.Successor.Execute(project); + await this.Successor.ExecuteAsync(project); } catch { diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BasePackageHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BasePackageHandler.cs index 26baa46..49a69fd 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BasePackageHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/BasePackageHandler.cs @@ -9,14 +9,14 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Handles a function relating to the NuGet package + /// Handles a function relating to the NuGet package. /// internal abstract class BasePackageHandler : IPackageHandler { /// /// Initializes a new instance of the class. /// - /// The successor + /// The successor. protected BasePackageHandler(IPackageHandler successor) { this.Successor = successor ?? throw new ArgumentNullException(nameof(successor)); @@ -29,16 +29,16 @@ protected BasePackageHandler(IPackageHandler successor) } /// - /// Gets the VS package + /// Gets the VS package. /// public AsyncPackage Package { get; } /// - /// Gets the successor handler + /// Gets the successor handler. /// protected IPackageHandler Successor { get; } /// - public abstract TPL.Task Execute(Project project); + public abstract TPL.Task ExecuteAsync(Project project); } } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/DialogInstallationHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/DialogInstallationHandler.cs index f24b315..600ff6e 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/DialogInstallationHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/DialogInstallationHandler.cs @@ -8,23 +8,23 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Performs installations while showing a wait dialog + /// Performs installations while showing a wait dialog. /// internal class DialogInstallationHandler : UserInstallationHandler { /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public DialogInstallationHandler(IPackageHandler successor) : base(successor) { } /// - public override async TPL.Task Execute(Project project) + public override async TPL.Task ExecuteAsync(Project project) { - if (await this.HasUserAcceptedWarningMessage(Resources.Resources.NugetUpdate_Title, Resources.Resources.NugetUpdate_Text)) + if (await this.HasUserAcceptedWarningMessageAsync(Resources.Resources.NugetUpdate_Title, Resources.Resources.NugetUpdate_Text)) { // Creates dialog informing the user to wait for the installation to finish IVsThreadedWaitDialogFactory twdFactory = await this.Package.GetServiceAsync(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory; @@ -37,7 +37,7 @@ public override async TPL.Task Execute(Project project) try { - await this.Successor.Execute(project); + await this.Successor.ExecuteAsync(project); } finally { diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/EmptyHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/EmptyHandler.cs index 0b942b4..4e4dd64 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/EmptyHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/EmptyHandler.cs @@ -9,14 +9,14 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// An empty handler that performs no actions + /// An empty handler that performs no actions. /// internal class EmptyHandler : IPackageHandler { /// /// Initializes a new instance of the class. /// - /// VS package + /// VS package. public EmptyHandler(AsyncPackage package) { this.Package = package ?? throw new ArgumentNullException(nameof(package)); @@ -26,7 +26,7 @@ public EmptyHandler(AsyncPackage package) public AsyncPackage Package { get; } /// - public TPL.Task Execute(Project project) + public TPL.Task ExecuteAsync(Project project) { // Do nothing return TPL.Task.CompletedTask; diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/IPackageHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/IPackageHandler.cs index 8da0589..ed3563c 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/IPackageHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/IPackageHandler.cs @@ -8,20 +8,20 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Representes a handler of nuget package actions + /// Representes a handler of nuget package actions. /// internal interface IPackageHandler { /// - /// Gets the VS package + /// Gets the VS package. /// AsyncPackage Package { get; } /// - /// Executes the function + /// Executes the function. /// - /// The project to peform actions on - /// A task that executes the function - TPL.Task Execute(Project project); + /// The project to peform actions on. + /// A task that executes the function. + TPL.Task ExecuteAsync(Project project); } } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NuGetUninstaller.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NuGetUninstaller.cs index abcb26c..d29c00d 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NuGetUninstaller.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NuGetUninstaller.cs @@ -10,27 +10,27 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Uninstalls older versions of the SlowCheetah NuGet package + /// Uninstalls older versions of the SlowCheetah NuGet package. /// internal class NuGetUninstaller : BasePackageHandler { /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public NuGetUninstaller(IPackageHandler successor) : base(successor) { } /// - public override async TPL.Task Execute(Project project) + public override async TPL.Task ExecuteAsync(Project project) { var componentModel = (IComponentModel)await this.Package.GetServiceAsync(typeof(SComponentModel)); IVsPackageUninstaller packageUninstaller = componentModel.GetService(); packageUninstaller.UninstallPackage(project, SlowCheetahNuGetManager.OldPackageName, true); - await this.Successor.Execute(project); + await this.Successor.ExecuteAsync(project); } } } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NugetInstaller.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NugetInstaller.cs index 674a00f..f547edd 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NugetInstaller.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/NugetInstaller.cs @@ -9,21 +9,21 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Installs the latest SlowCheetah NuGet package + /// Installs the latest SlowCheetah NuGet package. /// internal class NugetInstaller : BasePackageHandler { /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public NugetInstaller(IPackageHandler successor) : base(successor) { } /// - public override async TPL.Task Execute(Project project) + public override async TPL.Task ExecuteAsync(Project project) { var componentModel = (IComponentModel)await this.Package.GetServiceAsync(typeof(SComponentModel)); IVsPackageInstaller packageInstaller = componentModel.GetService(); @@ -34,7 +34,7 @@ public override async TPL.Task Execute(Project project) version: (string)null, // install latest stable version ignoreDependencies: false); - await this.Successor.Execute(project); + await this.Successor.ExecuteAsync(project); } } } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/TargetsUninstaller.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/TargetsUninstaller.cs index e8eec71..f4502ab 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/TargetsUninstaller.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/TargetsUninstaller.cs @@ -9,24 +9,24 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Uninstalls old SlowCheetah targets from the user's project file + /// Uninstalls old SlowCheetah targets from the user's project file. /// internal class TargetsUninstaller : BasePackageHandler { /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public TargetsUninstaller(IPackageHandler successor) : base(successor) { } /// - public override async TPL.Task Execute(Project project) + public override async TPL.Task ExecuteAsync(Project project) { // We handle any NuGet package logic before editing the project file - await this.Successor.Execute(project); + await this.Successor.ExecuteAsync(project); project.Save(); ProjectRootElement projectRoot = ProjectRootElement.Open(project.FullName); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/UserInstallationHandler.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/UserInstallationHandler.cs index c9da75d..66a7490 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/UserInstallationHandler.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/PackageHandlers/UserInstallationHandler.cs @@ -9,26 +9,26 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// Represents a handler that requires user input to install/uninstall packages + /// Represents a handler that requires user input to install/uninstall packages. /// internal abstract class UserInstallationHandler : BasePackageHandler { /// /// Initializes a new instance of the class. /// - /// The successor with the same package + /// The successor with the same package. public UserInstallationHandler(IPackageHandler successor) : base(successor) { } /// - /// Shows a warning message that the user must accept to continue + /// Shows a warning message that the user must accept to continue. /// - /// The title of the message box - /// The message to be shown - /// True if the user has accepted the warning message - protected async Task HasUserAcceptedWarningMessage(string title, string message) + /// The title of the message box. + /// The message to be shown. + /// True if the user has accepted the warning message. + protected async Task HasUserAcceptedWarningMessageAsync(string title, string message) { var shell = (IVsUIShell)await this.Package.GetServiceAsync(typeof(SVsUIShell)); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/SlowCheetahNuGetManager.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/SlowCheetahNuGetManager.cs index dd534cf..6092510 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/SlowCheetahNuGetManager.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/SlowCheetahNuGetManager.cs @@ -14,17 +14,17 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using TPL = System.Threading.Tasks; /// - /// Manages installations of the SlowCheetah NuGet package in the project + /// Manages installations of the SlowCheetah NuGet package in the project. /// public class SlowCheetahNuGetManager { /// - /// The name of the SlowCheetah NuGet package + /// The name of the SlowCheetah NuGet package. /// internal static readonly string PackageName = "Microsoft.VisualStudio.SlowCheetah"; /// - /// The previous name of the SlowCheetah NuGet package + /// The previous name of the SlowCheetah NuGet package. /// internal static readonly string OldPackageName = "SlowCheetah"; @@ -58,20 +58,20 @@ public class SlowCheetahNuGetManager /// /// Initializes a new instance of the class. /// - /// VS Package + /// VS Package. public SlowCheetahNuGetManager(AsyncPackage package) { this.package = package ?? throw new ArgumentNullException(nameof(package)); } /// - /// Checks if the current project supports NuGet + /// Checks if the current project supports NuGet. /// - /// Hierarchy of the project to be verified - /// True if the project supports NuGet + /// Hierarchy of the project to be verified. + /// True if the project supports NuGet. /// This implementation is derived of the internal NuGet method IsSupported /// https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/Utility/EnvDTEProjectUtility.cs#L441 - /// This should be removed when NuGet adds this to their public API + /// This should be removed when NuGet adds this to their public API. public bool ProjectSupportsNuget(IVsHierarchy hierarchy) { if (hierarchy == null) @@ -111,9 +111,9 @@ public bool ProjectSupportsNuget(IVsHierarchy hierarchy) /// If no version is installed, prompts for install of latest version; /// if an older version is detected, shows update information. /// - /// Hierarchy of the project to be verified + /// Hierarchy of the project to be verified. /// A representing the asynchronous operation. - public async TPL.Task CheckSlowCheetahInstallation(IVsHierarchy hierarchy) + public async TPL.Task CheckSlowCheetahInstallationAsync(IVsHierarchy hierarchy) { if (hierarchy == null) { @@ -160,11 +160,11 @@ public async TPL.Task CheckSlowCheetahInstallation(IVsHierarchy hierarchy) plan = new BackgroundInstallationHandler(plan) { // If the old package is installed, this is an update operation - IsUpdate = isOldScPackageInstalled + IsUpdate = isOldScPackageInstalled, }; } - await plan.Execute(currentProject); + await plan.ExecuteAsync(currentProject); } private static IVsPackageInstallerServices GetInstallerServices(IServiceProvider package) diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/VsProjectTypes.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/VsProjectTypes.cs index 653bf3b..134e5c4 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/VsProjectTypes.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/NugetHandler/VsProjectTypes.cs @@ -4,7 +4,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS { /// - /// VS project type GUIDs + /// VS project type GUIDs. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements must be documented", Justification = "Static collection of GUIDs")] internal static class VsProjectTypes diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsDialogPage.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsDialogPage.cs index 690604e..ddb31ef 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsDialogPage.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsDialogPage.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.Win32; /// - /// Advanced Options Page for SlowCheetah + /// Advanced Options Page for SlowCheetah. /// internal class AdvancedOptionsDialogPage : BaseOptionsDialogPage { @@ -20,7 +20,7 @@ internal class AdvancedOptionsDialogPage : BaseOptionsDialogPage /// /// Initializes a new instance of the class. - /// Constructor called by VSIP just in time when user wants to view this tools, options page + /// Constructor called by VSIP just in time when user wants to view this tools, options page. /// public AdvancedOptionsDialogPage() { @@ -28,12 +28,12 @@ public AdvancedOptionsDialogPage() } /// - /// Gets or sets the exe path for the diff tool used to preview transformations + /// Gets or sets the exe path for the diff tool used to preview transformations. /// public string PreviewToolExecutablePath { get; set; } /// - /// Gets or sets the required command on execution of the preview tool + /// Gets or sets the required command on execution of the preview tool. /// public string PreviewToolCommandLine { get; set; } @@ -122,7 +122,7 @@ public override void LoadSettingsFromStorage() } /// - /// Save Tools-->Options settings to registry + /// Save Tools-->Options settings to registry. /// public override void SaveSettingsToStorage() { diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsUserControl.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsUserControl.cs index 1041293..5c857cb 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsUserControl.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/AdvancedOptionsUserControl.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using System.Windows.Forms; /// - /// The UI for the advanced section of the options page + /// The UI for the advanced section of the options page. /// public partial class AdvancedOptionsUserControl : UserControl { @@ -22,9 +22,9 @@ public AdvancedOptionsUserControl() } /// - /// Initialized the Advanced Options Page Control + /// Initialized the Advanced Options Page Control. /// - /// The options page that corresponds to this control + /// The options page that corresponds to this control. internal void Initialize(AdvancedOptionsDialogPage advancedOptionsPage) { this.advancedOptionsPage = advancedOptionsPage; diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/BaseOptionsDialogPage.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/BaseOptionsDialogPage.cs index c4f642c..a9d6e37 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/BaseOptionsDialogPage.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/BaseOptionsDialogPage.cs @@ -6,12 +6,12 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell; /// - /// Base class for options page + /// Base class for options page. /// internal abstract class BaseOptionsDialogPage : DialogPage { /// - /// Registry key for all options + /// Registry key for all options. /// protected const string RegOptionsKey = "ConfigTransform"; } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsDialogPage.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsDialogPage.cs index dd5d33d..d211b4c 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsDialogPage.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsDialogPage.cs @@ -12,7 +12,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.Win32; /// - /// Options page for SlowCheetah + /// Options page for SlowCheetah. /// [System.Runtime.InteropServices.Guid("01B6BAC2-0BD6-4ead-95AE-6D6DE30A6286")] internal class OptionsDialogPage : BaseOptionsDialogPage @@ -22,7 +22,7 @@ internal class OptionsDialogPage : BaseOptionsDialogPage /// /// Initializes a new instance of the class. - /// Constructor called by VSIP just in time when user wants to view this tools, options page + /// Constructor called by VSIP just in time when user wants to view this tools, options page. /// public OptionsDialogPage() { @@ -30,12 +30,12 @@ public OptionsDialogPage() } /// - /// Gets or sets a value indicating whether preview is enabled or not + /// Gets or sets a value indicating whether preview is enabled or not. /// public bool EnablePreview { get; set; } /// - /// Gets or sets a value indicating whether to add DependentUpon metadata + /// Gets or sets a value indicating whether to add DependentUpon metadata. /// public bool AddDependentUpon { get; set; } @@ -125,7 +125,7 @@ public override void LoadSettingsFromStorage() } /// - /// Save Tools-->Options settings to registry + /// Save Tools-->Options settings to registry. /// public override void SaveSettingsToStorage() { @@ -149,7 +149,7 @@ public override void SaveSettingsToStorage() /// This event is raised when VS wants to deactivate this page. /// The page is deactivated unless the event is cancelled. /// - /// Arguments for the event + /// Arguments for the event. protected override void OnDeactivate(CancelEventArgs e) { } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsUserControl.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsUserControl.cs index 7a33987..2d19c3c 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsUserControl.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Options/OptionsUserControl.cs @@ -7,7 +7,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using System.Windows.Forms; /// - /// The UI for the options page + /// The UI for the options page. /// public partial class OptionsUserControl : UserControl { @@ -22,9 +22,9 @@ public OptionsUserControl() } /// - /// Initialized the Options Page Control + /// Initialized the Options Page Control. /// - /// The options page that corresponds to this control + /// The options page that corresponds to this control. internal void Initialize(OptionsDialogPage optionsPage) { this.optionsPage = optionsPage ?? throw new ArgumentNullException(nameof(optionsPage)); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/AddTransformCommand.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/AddTransformCommand.cs index b53c3c9..f176c83 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/AddTransformCommand.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/AddTransformCommand.cs @@ -18,7 +18,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// Add Transform command + /// Add Transform command. /// public class AddTransformCommand : BaseCommand { @@ -29,9 +29,9 @@ public class AddTransformCommand : BaseCommand /// /// Initializes a new instance of the class. /// - /// The VSPackage - /// The nuget manager for the VSPackage - /// VSPackage logger + /// The VSPackage. + /// The nuget manager for the VSPackage. + /// VSPackage logger. public AddTransformCommand(SlowCheetahPackage package, SlowCheetahNuGetManager nuGetManager, SlowCheetahPackageLogger logger) : base(package) { @@ -133,7 +133,7 @@ protected override void OnInvoke(object sender, EventArgs e) } // Checks the SlowCheetah NuGet package installation - this.package.JoinableTaskFactory.Run(() => this.nuGetManager.CheckSlowCheetahInstallation(hierarchy)); + this.package.JoinableTaskFactory.Run(() => this.nuGetManager.CheckSlowCheetahInstallationAsync(hierarchy)); // need to enure that this item has metadata TransformOnBuild set to true buildPropertyStorage.SetItemAttribute(itemid, SlowCheetahPackage.TransformOnBuild, "true"); @@ -179,11 +179,11 @@ protected override void OnInvoke(object sender, EventArgs e) /// /// Creates a new transformation file and adds it to the project. /// - /// The project hierarchy - /// The selected item to be transformed - /// Full name of the transformation file - /// Full path to the current project - /// Wheter to add the new file dependent upon the source file + /// The project hierarchy. + /// The selected item to be transformed. + /// Full name of the transformation file. + /// Full path to the current project. + /// Wheter to add the new file dependent upon the source file. private void AddTransformFile( IVsHierarchy hierarchy, ProjectItem selectedProjectItem, @@ -240,9 +240,9 @@ private void AddTransformFile( /// /// Verifies if an item supports transforms. /// - /// Current IVsProject - /// Id of the item inside the project - /// True if the item supports transforms + /// Current IVsProject. + /// Id of the item inside the project. + /// True if the item supports transforms. private bool ItemSupportsTransforms(IVsProject project, uint itemid) { if (ErrorHandler.Failed(project.GetMkDocument(itemid, out string itemFullPath))) @@ -272,11 +272,11 @@ private bool ItemSupportsTransforms(IVsProject project, uint itemid) } /// - /// Verifies any publish profiles in the project and returns it as a list of strings + /// Verifies any publish profiles in the project and returns it as a list of strings. /// - /// The current project hierarchy - /// Full path of the current project - /// List of publish profile names + /// The current project hierarchy. + /// Full path of the current project. + /// List of publish profile names. private IEnumerable GetPublishProfileTransforms(IVsHierarchy hierarchy, string projectPath) { if (hierarchy == null) diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/BaseCommand.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/BaseCommand.cs index 1d3d18a..fa73a19 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/BaseCommand.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/BaseCommand.cs @@ -8,33 +8,33 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell; /// - /// Base class for package commands + /// Base class for package commands. /// public abstract class BaseCommand { /// /// Initializes a new instance of the class. /// - /// The VSPackage as a servide provider + /// The VSPackage as a servide provider. public BaseCommand(AsyncPackage package) { this.Package = package ?? throw new ArgumentNullException(nameof(package)); } /// - /// Gets the ID of the command + /// Gets the ID of the command. /// public abstract int CommandId { get; } /// - /// Gets the package + /// Gets the package. /// protected AsyncPackage Package { get; } /// - /// Asynchronously registers the command in the command service + /// Asynchronously registers the command in the command service. /// - /// Async task + /// Async task. public async System.Threading.Tasks.Task RegisterCommandAsync() { await this.Package.JoinableTaskFactory.SwitchToMainThreadAsync(); @@ -50,25 +50,25 @@ public async System.Threading.Tasks.Task RegisterCommandAsync() } /// - /// This event is called when the command status has changed + /// This event is called when the command status has changed. /// - /// The object that fired the event - /// Event arguments + /// The object that fired the event. + /// Event arguments. protected abstract void OnChange(object sender, EventArgs e); /// /// This event is fired when a user right-clicks on a menu, but prior to the menu showing. /// This function is used to set the visibility of the menu. /// - /// The object that fired the event - /// Event arguments + /// The object that fired the event. + /// Event arguments. protected abstract void OnBeforeQueryStatus(object sender, EventArgs e); /// /// This function is the callback used to execute a command when the a menu item is clicked. /// - /// The object that fired the event - /// Event arguments + /// The object that fired the event. + /// Event arguments. protected abstract void OnInvoke(object sender, EventArgs e); } } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PackageSolutionEvents.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PackageSolutionEvents.cs index cf46754..d2f18aa 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PackageSolutionEvents.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PackageSolutionEvents.cs @@ -8,7 +8,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// Contains solution events for + /// Contains solution events for . /// public class PackageSolutionEvents : IVsUpdateSolutionEvents, IDisposable { @@ -17,8 +17,8 @@ public class PackageSolutionEvents : IVsUpdateSolutionEvents, IDisposable /// /// Initializes a new instance of the class. /// - /// The VSPackage - /// The error list provider + /// The VSPackage. + /// The error list provider. public PackageSolutionEvents(AsyncPackage asyncPackage, ErrorListProvider errorListProvider) { this.Package = asyncPackage ?? throw new ArgumentNullException(nameof(asyncPackage)); @@ -62,9 +62,9 @@ public int OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy) } /// - /// Asynchronously registers the solution eve + /// Asynchronously registers the solution eve. /// - /// Async task + /// Async task. public async System.Threading.Tasks.Task RegisterEventsAsync() { await this.Package.JoinableTaskFactory.SwitchToMainThreadAsync(); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PreviewTransformCommand.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PreviewTransformCommand.cs index df05e2e..e64a37d 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PreviewTransformCommand.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/PreviewTransformCommand.cs @@ -19,17 +19,17 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.SlowCheetah.Exceptions; /// - /// Preview Transform command + /// Preview Transform command. /// public class PreviewTransformCommand : BaseCommand, IDisposable { /// /// Initializes a new instance of the class. /// - /// The VSPackage - /// The nuget manager for the VSPackage - /// VSPackage logger - /// The VS error list provider + /// The VSPackage. + /// The nuget manager for the VSPackage. + /// VSPackage logger. + /// The VS error list provider. public PreviewTransformCommand( SlowCheetahPackage package, SlowCheetahNuGetManager nuGetManager, @@ -139,7 +139,7 @@ protected override void OnInvoke(object sender, EventArgs e) } // Checks the SlowCheetah NuGet package installation - this.ScPackage.JoinableTaskFactory.Run(() => this.NuGetManager.CheckSlowCheetahInstallation(hierarchy)); + this.ScPackage.JoinableTaskFactory.Run(() => this.NuGetManager.CheckSlowCheetahInstallationAsync(hierarchy)); // Get the parent of the file to start searching for the source file ErrorHandler.ThrowOnFailure(hierarchy.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_Parent, out object parentIdObj)); @@ -172,9 +172,9 @@ protected override void OnInvoke(object sender, EventArgs e) /// /// Shows a preview of the transformation in a temporary file. /// - /// Current IVsHierarchy - /// Full path to the file to be transformed - /// Full path to the transformation file + /// Current IVsHierarchy. + /// Full path to the file to be transformed. + /// Full path to the transformation file. private void PreviewTransform(IVsHierarchy hier, string sourceFile, string transformFile) { if (string.IsNullOrWhiteSpace(sourceFile)) @@ -273,12 +273,12 @@ private void PreviewTransform(IVsHierarchy hier, string sourceFile, string trans /// Searches for a file to transform based on a transformation file. /// Starts the search with the parent of the file then checks all visible children. /// - /// Current project hierarchy + /// Current project hierarchy. /// Parent ID of the file. - /// Name of the transformation file - /// ID of the file to transform - /// Resulting path of the file to transform - /// True if the correct file was found + /// Name of the transformation file. + /// ID of the file to transform. + /// Resulting path of the file to transform. + /// True if the correct file was found. private bool TryGetFileToTransform(IVsHierarchy hierarchy, uint parentId, string transformName, out uint docId, out string documentPath) { IVsProject project = (IVsProject)hierarchy; diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/SlowCheetahPackageLogger.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/SlowCheetahPackageLogger.cs index b8e80bc..b85cc9e 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/SlowCheetahPackageLogger.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Package/SlowCheetahPackageLogger.cs @@ -9,7 +9,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// A logger class for + /// A logger class for . /// public class SlowCheetahPackageLogger { @@ -18,17 +18,17 @@ public class SlowCheetahPackageLogger /// /// Initializes a new instance of the class. /// - /// The VSPackage + /// The VSPackage. public SlowCheetahPackageLogger(IServiceProvider package) { this.package = package ?? throw new ArgumentNullException(nameof(package)); } /// - /// Logs a message to the Activity Log + /// Logs a message to the Activity Log. /// - /// The message - /// The message arguments + /// The message. + /// The message arguments. public void LogMessage(string message, params object[] args) { if (string.IsNullOrWhiteSpace(message)) diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/Guids.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/Guids.cs index 91cd6ff..16e104f 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/Guids.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/Guids.cs @@ -11,32 +11,32 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using System; /// - /// List of Guids necessary for the SlowCheetah extension + /// List of Guids necessary for the SlowCheetah extension. /// public static class Guids { /// - /// Guid string of a Web Application project + /// Guid string of a Web Application project. /// public const string GuidWebApplicationString = "{349c5851-65df-11da-9384-00065b846f21}"; /// - /// Guid string for the SlowCheetah Visual Studio Package + /// Guid string for the SlowCheetah Visual Studio Package. /// public const string GuidSlowCheetahPkgString = "9eb9f150-fcc9-4db8-9e97-6aef2011017c"; /// - /// Guid string for the SlowCheetah commands + /// Guid string for the SlowCheetah commands. /// public const string GuidSlowCheetahCmdSetString = "eab4615a-3384-42bd-9589-e2df97a783ee"; /// - /// Guid for the SlowCheetah commands + /// Guid for the SlowCheetah commands. /// public static readonly Guid GuidSlowCheetahCmdSet = new Guid(GuidSlowCheetahCmdSetString); /// - /// Guid of a Web Application project + /// Guid of a Web Application project. /// public static readonly Guid GuidWebApplication = new Guid(GuidWebApplicationString); } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/PkgCmdID.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/PkgCmdID.cs index 9491e9d..c0a5a3b 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/PkgCmdID.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Resources/PkgCmdID.cs @@ -9,17 +9,17 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS { /// - /// List of the Command IDs for SlowCheetah + /// List of the Command IDs for SlowCheetah. /// public static class PkgCmdID { /// - /// ID for the "Add Transform" command + /// ID for the "Add Transform" command. /// public const uint CmdIdAddTransform = 0x100; /// - /// ID for the "Preview Transform" command + /// ID for the "Preview Transform" command. /// public const uint CmdIdPreviewTransform = 0x101; } diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/SlowCheetahPackage.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/SlowCheetahPackage.cs index ddc99fe..883331e 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/SlowCheetahPackage.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/SlowCheetahPackage.cs @@ -51,17 +51,17 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS public sealed partial class SlowCheetahPackage : AsyncPackage { /// - /// The TransformOnBuild metadata name + /// The TransformOnBuild metadata name. /// public static readonly string TransformOnBuild = "TransformOnBuild"; /// - /// The IsTransformFile metadata name + /// The IsTransformFile metadata name. /// public static readonly string IsTransformFile = "IsTransformFile"; /// - /// The DependentUpon metadata name + /// The DependentUpon metadata name. /// public static readonly string DependentUpon = "DependentUpon"; @@ -78,7 +78,7 @@ public SlowCheetahPackage() } /// - /// Gets the SlowCheetahPackage + /// Gets the SlowCheetahPackage. /// public static SlowCheetahPackage OurPackage { get; private set; } @@ -97,19 +97,19 @@ public SlowCheetahPackage() /// /// Verifies if the current project supports transformations. /// - /// Current IVsProject - /// True if the project supports transformation + /// Current IVsProject. + /// True if the project supports transformation. public bool ProjectSupportsTransforms(IVsProject project) { return this.NuGetManager.ProjectSupportsNuget(project as IVsHierarchy); } /// - /// Verifies if the item has a trasform configured already + /// Verifies if the item has a trasform configured already. /// - /// The current project - /// The id of the selected item inside the project - /// True if the item has a transform + /// The current project. + /// The id of the selected item inside the project. + /// True if the item has a transform. public bool IsItemTransformItem(IVsProject vsProject, uint itemid) { IVsBuildPropertyStorage buildPropertyStorage = vsProject as IVsBuildPropertyStorage; diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/TransformationPreviewLogger.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/TransformationPreviewLogger.cs index 250086a..b185162 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/TransformationPreviewLogger.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/TransformationPreviewLogger.cs @@ -15,7 +15,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using SlowCheetah; /// - /// Logger for XDT transformation on Preview Transform + /// Logger for XDT transformation on Preview Transform. /// public class TransformationPreviewLogger : ITransformationLogger { @@ -25,8 +25,8 @@ public class TransformationPreviewLogger : ITransformationLogger /// /// Initializes a new instance of the class. /// - /// The VS Package - /// The current project hierarchy + /// The VS Package. + /// The current project hierarchy. public TransformationPreviewLogger(ErrorListProvider errorListProvider, IVsHierarchy hierachy) { this.errorListProvider = errorListProvider ?? throw new ArgumentNullException(nameof(errorListProvider)); diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/PackageUtilities.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/PackageUtilities.cs index 6c28151..221da9e 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/PackageUtilities.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/PackageUtilities.cs @@ -17,7 +17,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// Utilities class for the Visual Studio Extension Package + /// Utilities class for the Visual Studio Extension Package. /// public class PackageUtilities { @@ -63,10 +63,10 @@ public class PackageUtilities }; /// - /// Verifies if the extension of the given file is supported + /// Verifies if the extension of the given file is supported. /// - /// Full path to the file - /// True if the file is supported + /// Full path to the file. + /// True if the file is supported. public static bool IsExtensionSupportedForFile(string filePath) { if (string.IsNullOrWhiteSpace(filePath)) @@ -83,11 +83,11 @@ public static bool IsExtensionSupportedForFile(string filePath) } /// - /// Creates a temporary file name with an optional extension + /// Creates a temporary file name with an optional extension. /// - /// Whether it is ensured the file does not exist - /// Optional extension for the file - /// Full path to the temporary file + /// Whether it is ensured the file does not exist. + /// Optional extension for the file. + /// Full path to the temporary file. public static string GetTempFilename(bool ensureFileDoesntExist, string extension = null) { string path = Path.GetTempFileName(); @@ -116,12 +116,12 @@ public static string GetTempFilename(bool ensureFileDoesntExist, string extensio /// /// Checks if a file is a transform of another file according to their names and the given configurations - /// If a given file is "name.extension", a transfomation file should be "name.{configuration}.extension" + /// If a given file is "name.extension", a transfomation file should be "name.{configuration}.extension". /// - /// Name of the source file - /// Name of the potential transform file - /// Project configurations - /// True if the names correspond to compatible transformation files + /// Name of the source file. + /// Name of the potential transform file. + /// Project configurations. + /// True if the names correspond to compatible transformation files. public static bool IsFileTransformForBuildConfiguration(string documentName, string transformName, IEnumerable configs) { if (configs == null || !configs.Any()) @@ -141,11 +141,11 @@ public static bool IsFileTransformForBuildConfiguration(string documentName, str /// /// Checks if a file is a generic transform of another file - /// If a given file is "name.extension", a transfomation file should be "name.{something}.extension" + /// If a given file is "name.extension", a transfomation file should be "name.{something}.extension". /// - /// Name of the source file - /// Name of the potential transform file - /// True if the names correspond to compatible transformation files + /// Name of the source file. + /// Name of the potential transform file. + /// True if the names correspond to compatible transformation files. public static bool IsGenericFileTransform(string documentName, string transformName) { return TryGetFileTransform(documentName, transformName, out _); @@ -154,7 +154,7 @@ public static bool IsGenericFileTransform(string documentName, string transformN /// /// Gets if a path is valid or not. /// - /// The path to check if it is valid + /// The path to check if it is valid. /// True if path is valid, false otherwise. public static bool IsPathValid(string path) { @@ -168,12 +168,12 @@ public static bool IsPathValid(string path) } /// - /// Gets an item from the project hierarchy + /// Gets an item from the project hierarchy. /// - /// Type of object to be fetched - /// Current IVsHierarchy - /// ID of the desired item in the project - /// The desired object typed to T + /// Type of object to be fetched. + /// Current IVsHierarchy. + /// ID of the desired item in the project. + /// The desired object typed to T. public static T GetAutomationFromHierarchy(IVsHierarchy pHierarchy, uint itemID) where T : class { diff --git a/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/ProjectUtilities.cs b/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/ProjectUtilities.cs index aa17ce1..b19a103 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/ProjectUtilities.cs +++ b/src/Microsoft.VisualStudio.SlowCheetah.VS/Utilities/ProjectUtilities.cs @@ -17,7 +17,7 @@ namespace Microsoft.VisualStudio.SlowCheetah.VS using Microsoft.VisualStudio.Shell.Interop; /// - /// Utilities class for the Visual Studio Extension Package that deals specifically with projects + /// Utilities class for the Visual Studio Extension Package that deals specifically with projects. /// public static class ProjectUtilities { @@ -28,20 +28,20 @@ public static class ProjectUtilities private static IEnumerable supportedItemExtensions; /// - /// Gets the DTE from current context + /// Gets the DTE from current context. /// - /// The Visual Studio DTE object + /// The Visual Studio DTE object. public static DTE GetDTE() { return (DTE)Package.GetGlobalService(typeof(DTE)); } /// - /// Verifies if a single object is selected + /// Verifies if a single object is selected. /// - /// Current selected project hierarchy - /// ID of the selected item - /// True if a single item is selected + /// Current selected project hierarchy. + /// ID of the selected item. + /// True if a single item is selected. public static bool IsSingleProjectItemSelection(out IVsHierarchy hierarchy, out uint itemid) { hierarchy = null; @@ -112,10 +112,10 @@ public static bool IsSingleProjectItemSelection(out IVsHierarchy hierarchy, out } /// - /// Gets all project configurations + /// Gets all project configurations. /// - /// Current open project - /// List of configuration names for that project + /// Current open project. + /// List of configuration names for that project. public static IEnumerable GetProjectConfigurations(Project project) { List configurations = new List(); @@ -136,10 +136,10 @@ public static IEnumerable GetProjectConfigurations(Project project) } /// - /// Gets all project configurations + /// Gets all project configurations. /// - /// Current project hierarchy - /// List of configuration names for that project + /// Current project hierarchy. + /// List of configuration names for that project. public static IEnumerable GetProjectConfigurations(IVsHierarchy hierarchy) { Project project = PackageUtilities.GetAutomationFromHierarchy(hierarchy, (uint)VSConstants.VSITEMID.Root); @@ -147,10 +147,10 @@ public static IEnumerable GetProjectConfigurations(IVsHierarchy hierarch } /// - /// Retrieves the supported project extensions from the package settings + /// Retrieves the supported project extensions from the package settings. /// - /// The settings manager for the project - /// List of supported project extensions starting with '.' + /// The settings manager for the project. + /// List of supported project extensions starting with '.'. public static IEnumerable GetSupportedProjectExtensions(IVsSettingsManager settingsManager) { if (supportedProjectExtensions == null) @@ -162,10 +162,10 @@ public static IEnumerable GetSupportedProjectExtensions(IVsSettingsManag } /// - /// Retrieves the supported item extensions from the package settings + /// Retrieves the supported item extensions from the package settings. /// - /// The settings manager for the project - /// A list of supported item extensions + /// The settings manager for the project. + /// A list of supported item extensions. public static IEnumerable GetSupportedItemExtensions(IVsSettingsManager settingsManager) { if (supportedItemExtensions == null) @@ -180,8 +180,8 @@ public static IEnumerable GetSupportedItemExtensions(IVsSettingsManager /// Verifies if the given project is a Web Application. /// Checks the type GUIDs for that project. /// - /// Project to verify - /// True if a subtype GUID matches the Web App Guid in Resources + /// Project to verify. + /// True if a subtype GUID matches the Web App Guid in Resources. public static bool IsProjectWebApp(IVsProject project) { if (project is IVsAggregatableProject aggregatableProject) diff --git a/src/Microsoft.VisualStudio.SlowCheetah.Vsix/Microsoft.VisualStudio.SlowCheetah.Vsix.csproj b/src/Microsoft.VisualStudio.SlowCheetah.Vsix/Microsoft.VisualStudio.SlowCheetah.Vsix.csproj index 0578c95..196ef61 100644 --- a/src/Microsoft.VisualStudio.SlowCheetah.Vsix/Microsoft.VisualStudio.SlowCheetah.Vsix.csproj +++ b/src/Microsoft.VisualStudio.SlowCheetah.Vsix/Microsoft.VisualStudio.SlowCheetah.Vsix.csproj @@ -80,8 +80,14 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + @@ -95,14 +101,9 @@ - - + -