From c7c337a5f4a88ca3c44f8536be88e6cc0fc34ba0 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Thu, 9 Jul 2020 15:18:49 -0700 Subject: [PATCH] Fix/suppress release build violations --- .../Core/Implementation/TextBufferAssociatedViewService.cs | 2 ++ ...synchronousTaggerProvider.TagSource_ReferenceCounting.cs | 6 +++--- .../CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/EditorFeatures/Core/Implementation/TextBufferAssociatedViewService.cs b/src/EditorFeatures/Core/Implementation/TextBufferAssociatedViewService.cs index 57c0cb7b252..c569cb22257 100644 --- a/src/EditorFeatures/Core/Implementation/TextBufferAssociatedViewService.cs +++ b/src/EditorFeatures/Core/Implementation/TextBufferAssociatedViewService.cs @@ -123,7 +123,9 @@ public static bool AnyAssociatedViewHasFocus(ITextBuffer textBuffer) } [Conditional("DEBUG")] +#pragma warning disable CA1822 // Mark members as static - accesses instance members within #if DEBUG private void DebugRegisterView_NoLock(ITextView textView) +#pragma warning restore CA1822 // Mark members as static { #if DEBUG if (s_registeredViews.Add(textView)) diff --git a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs index c6b9cac9eb6..39e71b89159 100644 --- a/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs +++ b/src/EditorFeatures/Core/Tagging/AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs @@ -104,15 +104,15 @@ private void DebugRecordCurrentThread() private void DebugVerifyThread() => Contract.ThrowIfFalse(Thread.CurrentThread == _thread); #else - private void DebugRecordInitialStackTrace() + private static void DebugRecordInitialStackTrace() { } - private void DebugRecordCurrentThread() + private static void DebugRecordCurrentThread() { } - private void DebugVerifyThread() + private static void DebugVerifyThread() { } #endif diff --git a/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs index 9e71eb7d45d..3b4a0b9b9f9 100644 --- a/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs +++ b/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs @@ -161,7 +161,7 @@ private static void MakeProjectsAndDocumentsRooted(TestWorkspace workspace) return; } - private void AddAnalyzerConfigDocumentWithOptions(TestWorkspace workspace, OptionsCollection options) + private static void AddAnalyzerConfigDocumentWithOptions(TestWorkspace workspace, OptionsCollection options) { Debug.Assert(options != null); var analyzerConfigText = GenerateAnalyzerConfigText(options); -- GitLab