From 98096c7fdd3e20f815d8027b4140033d9f10de44 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Thu, 31 May 2018 10:18:57 -0700 Subject: [PATCH] cleanup namespaces --- Common/Product/SharedProject/ProcessOutput.cs | 12 ++++-------- .../TestAdapterImpl/ServiceProviderExtension.cs | 2 +- .../TestAdapterImpl/TestFileAddRemoveListener.cs | 4 ++-- .../TestAdapterImpl/TestFilesUpdateWatcher.cs | 2 +- Nodejs/Product/TestAdapterImpl/TestMethodResolver.cs | 1 - .../Product/TestAdapterImpl/VsProjectExtensions.cs | 11 ++--------- 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Common/Product/SharedProject/ProcessOutput.cs b/Common/Product/SharedProject/ProcessOutput.cs index 224a4f4ac..7b28b9fa4 100644 --- a/Common/Product/SharedProject/ProcessOutput.cs +++ b/Common/Product/SharedProject/ProcessOutput.cs @@ -640,10 +640,10 @@ public ProcessPriorityClass PriorityClass /// public void WriteInputLine(string line) { - if (IsStarted && redirector != null && !redirector.CloseStandardInput()) + if (this.IsStarted && this.redirector != null && !this.redirector.CloseStandardInput()) { - Process.StandardInput.WriteLine(line); - Process.StandardInput.Flush(); + this.Process.StandardInput.WriteLine(line); + this.Process.StandardInput.Flush(); } } @@ -824,11 +824,7 @@ private void OnExited(object sender, EventArgs e) } this.haveRaisedExitedEvent = true; FlushAndCloseOutput(); - var evt = Exited; - if (evt != null) - { - evt(this, e); - } + Exited?.Invoke(this, e); } /// diff --git a/Nodejs/Product/TestAdapterImpl/ServiceProviderExtension.cs b/Nodejs/Product/TestAdapterImpl/ServiceProviderExtension.cs index 91a9aff10..04a5d49a1 100644 --- a/Nodejs/Product/TestAdapterImpl/ServiceProviderExtension.cs +++ b/Nodejs/Product/TestAdapterImpl/ServiceProviderExtension.cs @@ -4,7 +4,7 @@ using System.Globalization; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudioTools.TestAdapter +namespace Microsoft.NodejsTools.TestAdapter { internal static class ServiceProviderExtensions { diff --git a/Nodejs/Product/TestAdapterImpl/TestFileAddRemoveListener.cs b/Nodejs/Product/TestAdapterImpl/TestFileAddRemoveListener.cs index 8d5fa8846..c0c541700 100644 --- a/Nodejs/Product/TestAdapterImpl/TestFileAddRemoveListener.cs +++ b/Nodejs/Product/TestAdapterImpl/TestFileAddRemoveListener.cs @@ -6,7 +6,7 @@ using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudioTools.TestAdapter +namespace Microsoft.NodejsTools.TestAdapter { internal sealed class TestFileChangedEventArgs : EventArgs { @@ -24,7 +24,7 @@ public TestFileChangedEventArgs(string file, WatcherChangeTypes reason, IVsProje internal sealed class TestFileAddRemoveListener : IVsTrackProjectDocumentsEvents2, IDisposable { - private IVsTrackProjectDocuments2 _projectDocTracker; + private readonly IVsTrackProjectDocuments2 _projectDocTracker; private uint _cookie = VSConstants.VSCOOKIE_NIL; private Guid _testProjectGuid; diff --git a/Nodejs/Product/TestAdapterImpl/TestFilesUpdateWatcher.cs b/Nodejs/Product/TestAdapterImpl/TestFilesUpdateWatcher.cs index 02b7dc4e0..6e5296b6d 100644 --- a/Nodejs/Product/TestAdapterImpl/TestFilesUpdateWatcher.cs +++ b/Nodejs/Product/TestAdapterImpl/TestFilesUpdateWatcher.cs @@ -8,7 +8,7 @@ using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudioTools.TestAdapter +namespace Microsoft.NodejsTools.TestAdapter { // TODO: consider replacing this with Microsoft.VisualStudioTools.Project.FileChangeManager. (When we have an assembly we can use to share code) diff --git a/Nodejs/Product/TestAdapterImpl/TestMethodResolver.cs b/Nodejs/Product/TestAdapterImpl/TestMethodResolver.cs index 73e2621c5..2881793a3 100644 --- a/Nodejs/Product/TestAdapterImpl/TestMethodResolver.cs +++ b/Nodejs/Product/TestAdapterImpl/TestMethodResolver.cs @@ -7,7 +7,6 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.TestWindow.Extensibility; -using Microsoft.VisualStudioTools.TestAdapter; using MSBuild = Microsoft.Build.Evaluation; namespace Microsoft.NodejsTools.TestAdapter diff --git a/Nodejs/Product/TestAdapterImpl/VsProjectExtensions.cs b/Nodejs/Product/TestAdapterImpl/VsProjectExtensions.cs index b75a306c8..0cba3b8cd 100644 --- a/Nodejs/Product/TestAdapterImpl/VsProjectExtensions.cs +++ b/Nodejs/Product/TestAdapterImpl/VsProjectExtensions.cs @@ -3,14 +3,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using Microsoft.NodejsTools; using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Flavor; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudioTools.TestAdapter +namespace Microsoft.NodejsTools.TestAdapter { internal static class VSProjectExtensions { @@ -100,12 +98,7 @@ out var extObject try { var projHome = props.Item("ProjectHome"); - if (projHome == null) - { - return null; - } - - return projHome.Value as string; + return projHome == null ? null : projHome.Value as string; } catch (ArgumentException) {