Skip to content

Commit

Permalink
Merge pull request #9277 from drewnoakes/simplify-polyfill
Browse files Browse the repository at this point in the history
Simplify using non-generic TaskCompletionSource polyfill
  • Loading branch information
drewnoakes authored Oct 10, 2023
2 parents 9b28338 + fea9bc3 commit d0efb44
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
using Microsoft.VisualStudio.ProjectSystem.Utilities;
using Microsoft.VisualStudio.Threading;

// .NET Core defines a non-generic TaskCompletionSource but .NETFramework does not.
// For consistency, always use the one we define.
using TaskCompletionSource = Microsoft.VisualStudio.Threading.Tasks.TaskCompletionSource;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
using Microsoft.VisualStudio.ProjectSystem.Utilities;
using Microsoft.VisualStudio.Threading;

// .NET Core defines a non-generic TaskCompletionSource but .NETFramework does not.
// For consistency, always use the one we define.
using TaskCompletionSource = Microsoft.VisualStudio.Threading.Tasks.TaskCompletionSource;

namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.VisualStudio.ProjectSystem.Properties;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Threading;
using Microsoft.VisualStudio.Threading.Tasks;

namespace Microsoft.VisualStudio.ProjectSystem.VS
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

// .NET Core defines a non-generic TaskCompletionSource but .NETFramework does not.
// For consistency, always use the one we define.
using TaskCompletionSource = Microsoft.VisualStudio.Threading.Tasks.TaskCompletionSource;

namespace Microsoft.VisualStudio.ProjectSystem.Build
{
[Export(typeof(IConfiguredProjectReadyToBuild))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
using Microsoft.VisualStudio.Threading;
using Microsoft.VisualStudio.Threading.Tasks;

// .NET Core defines a non-generic TaskCompletionSource but .NETFramework does not.
// For consistency, always use the one we define.
using TaskCompletionSource = Microsoft.VisualStudio.Threading.Tasks.TaskCompletionSource;

namespace Microsoft.VisualStudio.ProjectSystem.Debug
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

using Microsoft.VisualStudio.Threading;

// .NET Core defines a non-generic TaskCompletionSource but .NETFramework does not.
// For consistency, always use the one we define.
using TaskCompletionSource = Microsoft.VisualStudio.Threading.Tasks.TaskCompletionSource;

namespace Microsoft.VisualStudio.ProjectSystem
{
[Export]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

#if NETFRAMEWORK

using System.ComponentModel;

namespace Microsoft.VisualStudio.Threading.Tasks
namespace System.Threading.Tasks
{
/// <inheritdoc cref="TaskCompletionSource{TResult}"/>
/// <remarks>
Expand Down Expand Up @@ -54,3 +56,5 @@ public bool TrySetResult()
}
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

using Microsoft.VisualStudio.Threading.Tasks;
using Xunit.Sdk;

namespace Microsoft.VisualStudio.ProjectSystem.VS.TempPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.VisualStudio.LanguageServices.ProjectSystem;
using Microsoft.VisualStudio.ProjectSystem.LanguageServices;
using Microsoft.VisualStudio.Telemetry;
using Microsoft.VisualStudio.Threading.Tasks;
using Xunit.Sdk;

namespace Microsoft.VisualStudio.ProjectSystem.VS.TempPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Threading.Tasks;
using Xunit.Sdk;

// Nullable annotations don't add a lot of value to this class, and until https://github.com/dotnet/roslyn/issues/33199 is fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

using Microsoft.VisualStudio.Threading.Tasks;

namespace Microsoft.VisualStudio.ProjectSystem.VS.Utilities
{
internal static class TestUtil
Expand Down

0 comments on commit d0efb44

Please sign in to comment.