Skip to content

Commit

Permalink
Fix release build - conditionally exclude usings only used for DEBUG …
Browse files Browse the repository at this point in the history
…only code
  • Loading branch information
mavasani committed Apr 7, 2020
1 parent 0ed2920 commit f8009ac
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Microsoft.CodeAnalysis.PooledObjects;

#if DEBUG
using System.Linq;
#endif

namespace Microsoft.CodeAnalysis
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Roslyn.Utilities
{
internal static partial class EnumerableExtensions
Expand Down
5 changes: 4 additions & 1 deletion src/Compilers/Core/Portable/InternalUtilities/StringTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
#nullable enable

using System;
using System.Diagnostics;
using System.Text;
using System.Threading;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis;

#if DEBUG
using System.Diagnostics;
#endif

namespace Roslyn.Utilities
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
Expand All @@ -16,6 +15,10 @@
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.SolutionCrawler
{
internal sealed partial class SolutionCrawlerRegistrationService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.PooledObjects;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.Wrapping.BinaryExpression
{
using Microsoft.CodeAnalysis.Indentation;
Expand Down
5 changes: 4 additions & 1 deletion src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Execution;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.Remote
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Collections;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;

#if DEBUG
using Microsoft.CodeAnalysis.Shared.Extensions;
#endif

namespace Microsoft.CodeAnalysis.Simplification
{
internal abstract class AbstractSimplificationService<TExpressionSyntax, TStatementSyntax, TCrefSyntax> : ISimplificationService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
Expand All @@ -14,6 +13,10 @@
using Microsoft.CodeAnalysis.Storage;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.SQLite.v1
{
internal partial class SQLitePersistentStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.SQLite.v2.Interop;
using Microsoft.CodeAnalysis.Storage;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.SQLite.v2
{
internal partial class SQLitePersistentStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using System.Threading;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

using System;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using Microsoft.CodeAnalysis;
using Roslyn.Utilities;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis
{
internal partial class SolutionState
Expand Down
5 changes: 4 additions & 1 deletion src/Workspaces/Remote/Core/Services/SolutionCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Remote.DebugUtil;
using Microsoft.CodeAnalysis.Serialization;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
Expand All @@ -19,6 +18,10 @@
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.ErrorReporting;

#if DEBUG
using Microsoft.CodeAnalysis.Remote.DebugUtil;
#endif

namespace Microsoft.CodeAnalysis.Remote
{
/// <summary>
Expand Down
9 changes: 6 additions & 3 deletions src/Workspaces/Remote/Core/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Serialization;

#if DEBUG
using System.Diagnostics;
using System.Text;
using Microsoft.CodeAnalysis.Internal.Log;
#endif

namespace Microsoft.CodeAnalysis.Remote.DebugUtil
{
internal static class TestUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using System.Text;
using Microsoft.CodeAnalysis.Text;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars
{
internal partial struct VirtualCharSequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
using Microsoft.CodeAnalysis.PooledObjects;

#if DEBUG
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.FlowAnalysis
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -18,6 +16,11 @@
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;

#if DEBUG
using System.Collections.Immutable;
using System.Diagnostics;
#endif

namespace Microsoft.CodeAnalysis.Shared.Extensions
{
internal static partial class DocumentExtensions
Expand Down

0 comments on commit f8009ac

Please sign in to comment.