diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/IUnitTestingExperimentationServiceAccessor.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/IUnitTestingExperimentationServiceAccessor.cs deleted file mode 100644 index 44421c28ff7d4..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/IUnitTestingExperimentationServiceAccessor.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using Microsoft.CodeAnalysis.Host; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal interface IUnitTestingExperimentationServiceAccessor : IWorkspaceService - { - bool IsExperimentEnabled(string experimentName); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingExceptionUtilitesHelpers.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingExceptionUtilitesHelpers.cs deleted file mode 100644 index 0ff1f437a13f0..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingExceptionUtilitesHelpers.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal static class UnitTestingExceptionUtilitesHelpers - { - public static Exception Unreachable => ExceptionUtilities.Unreachable; - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingImmutableArrayExtensions.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingImmutableArrayExtensions.cs deleted file mode 100644 index 950c7f8e7ee17..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingImmutableArrayExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.IO; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal static class UnitTestingImmutableArrayExtensions - { - public static ImmutableArray ToImmutable(this MemoryStream stream) - => ImmutableArrayExtensions.ToImmutable(stream); - - public static bool SetEquals(this ImmutableArray array1, ImmutableArray array2, IEqualityComparer comparer) - => ImmutableArrayExtensions.SetEquals(array1, array2, comparer); - - public static ImmutableArray AsImmutable(this IEnumerable items) - => ImmutableArrayExtensions.AsImmutable(items); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingInvocationReasonsWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingInvocationReasonsWrapper.cs index 234b56cb68602..55952d114581c 100644 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingInvocationReasonsWrapper.cs +++ b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingInvocationReasonsWrapper.cs @@ -32,15 +32,8 @@ internal readonly struct UnitTestingInvocationReasonsWrapper internal UnitTestingInvocationReasonsWrapper(InvocationReasons underlyingObject) => UnderlyingObject = underlyingObject; - public UnitTestingInvocationReasonsWrapper(string reason) : this(new InvocationReasons(reason)) { } - - [Obsolete] - public bool Contains(string reason) - => UnderlyingObject.Contains(reason); - - [Obsolete] - public UnitTestingInvocationReasonsWrapper With(string reason) - => new UnitTestingInvocationReasonsWrapper(UnderlyingObject.With(reason)); + public UnitTestingInvocationReasonsWrapper(string reason) + : this(new InvocationReasons(reason)) { } public UnitTestingInvocationReasonsWrapper With(UnitTestingInvocationReasonsWrapper reason) => new UnitTestingInvocationReasonsWrapper(reason.UnderlyingObject.With(UnderlyingObject)); diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingKeepAliveSessionWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingKeepAliveSessionWrapper.cs deleted file mode 100644 index 0fc38655eef28..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingKeepAliveSessionWrapper.cs +++ /dev/null @@ -1,43 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingKeepAliveSessionWrapper - { - internal RemoteServiceConnection UnderlyingObject { get; } - - internal UnitTestingKeepAliveSessionWrapper(RemoteServiceConnection underlyingObject) - => UnderlyingObject = underlyingObject; - - public bool IsDefault => UnderlyingObject == null; - - public Task TryInvokeAsync(string targetName, Solution solution, IReadOnlyList arguments, CancellationToken cancellationToken) - => UnderlyingObject.RunRemoteAsync(targetName, solution, arguments, cancellationToken); - - public async Task TryInvokeAsync(string targetName, IReadOnlyList arguments, CancellationToken cancellationToken) - { - await UnderlyingObject.RunRemoteAsync(targetName, solution: null, arguments, cancellationToken).ConfigureAwait(false); - return true; - } - - public async Task TryInvokeAsync(string targetName, Solution solution, IReadOnlyList arguments, CancellationToken cancellationToken) - { - await UnderlyingObject.RunRemoteAsync(targetName, solution, arguments, cancellationToken).ConfigureAwait(false); - return true; - } - - public Task TryInvokeAsync(string targetName, IReadOnlyList arguments, CancellationToken cancellationToken) - => UnderlyingObject.RunRemoteAsync(targetName, solution: null, arguments, cancellationToken); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingPredefinedInvocationReasonsAccessor.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingPredefinedInvocationReasonsAccessor.cs deleted file mode 100644 index f36cab15c001e..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingPredefinedInvocationReasonsAccessor.cs +++ /dev/null @@ -1,27 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using Microsoft.CodeAnalysis.SolutionCrawler; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal static class UnitTestingPredefinedInvocationReasonsAccessor - { - public const string Reanalyze = PredefinedInvocationReasons.Reanalyze; - public const string SemanticChanged = PredefinedInvocationReasons.SemanticChanged; - public const string SyntaxChanged = PredefinedInvocationReasons.SyntaxChanged; - public const string ProjectConfigurationChanged = PredefinedInvocationReasons.ProjectConfigurationChanged; - public const string DocumentAdded = PredefinedInvocationReasons.DocumentAdded; - public const string DocumentOpened = PredefinedInvocationReasons.DocumentOpened; - public const string DocumentRemoved = PredefinedInvocationReasons.DocumentRemoved; - public const string DocumentClosed = PredefinedInvocationReasons.DocumentClosed; - public const string HighPriority = PredefinedInvocationReasons.HighPriority; - public const string ProjectParseOptionsChanged = PredefinedInvocationReasons.ProjectParseOptionsChanged; - public const string SolutionRemoved = PredefinedInvocationReasons.SolutionRemoved; - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingRemoteHostClientWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingRemoteHostClientWrapper.cs index 41dfbe02697c3..4b80312787c51 100644 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingRemoteHostClientWrapper.cs +++ b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingRemoteHostClientWrapper.cs @@ -37,35 +37,6 @@ public async Task> TryRunRemoteAsync(UnitTestingServiceHubService public async Task CreateConnectionAsync(UnitTestingServiceHubService service, object? callbackTarget, CancellationToken cancellationToken) => new UnitTestingRemoteServiceConnectionWrapper(await UnderlyingObject!.CreateConnectionAsync((WellKnownServiceHubService)service, callbackTarget, cancellationToken).ConfigureAwait(false)); - [Obsolete] - public async Task TryCreateUnitTestingKeepAliveSessionWrapperAsync(string serviceName, CancellationToken cancellationToken) - { - var connection = await UnderlyingObject!.CreateConnectionAsync(new RemoteServiceName(serviceName), callbackTarget: null, cancellationToken).ConfigureAwait(false); - return new UnitTestingKeepAliveSessionWrapper(connection); - } - - [Obsolete] - public async Task TryCreateUnitingSessionWithSolutionWrapperAsync(string serviceName, Solution solution, CancellationToken cancellationToken) - { - var connection = await UnderlyingObject!.CreateConnectionAsync(new RemoteServiceName(serviceName), callbackTarget: null, cancellationToken).ConfigureAwait(false); - - SessionWithSolution? session = null; - try - { - // transfer ownership of the connection to the session object: - session = await SessionWithSolution.CreateAsync(connection, solution, cancellationToken).ConfigureAwait(false); - } - finally - { - if (session == null) - { - connection.Dispose(); - } - } - - return new UnitTestingSessionWithSolutionWrapper(session); - } - [Obsolete] public event EventHandler StatusChanged { diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSessionWithSolutionWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSessionWithSolutionWrapper.cs deleted file mode 100644 index ba421a854dd54..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSessionWithSolutionWrapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingSessionWithSolutionWrapper : IDisposable - { - internal SessionWithSolution? UnderlyingObject { get; } - - public bool IsDefault => UnderlyingObject == null; - - public UnitTestingSessionWithSolutionWrapper(SessionWithSolution underlyingObject) - => UnderlyingObject = underlyingObject; - - public Task InvokeAsync(string targetName, IReadOnlyList arguments, CancellationToken cancellationToken) - => UnderlyingObject!.KeepAliveSession.RunRemoteAsync(targetName, solution: null, arguments, cancellationToken); - - public Task InvokeAsync(string targetName, IReadOnlyList arguments, CancellationToken cancellationToken) - => UnderlyingObject!.KeepAliveSession.RunRemoteAsync(targetName, solution: null, arguments, cancellationToken); - - public void Dispose() - => UnderlyingObject?.Dispose(); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionExtensions.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionExtensions.cs index 77ee088cbf35b..9314a9449eeac 100644 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionExtensions.cs +++ b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionExtensions.cs @@ -17,9 +17,5 @@ public static int GetWorkspaceVersion(this Solution solution) public static async Task GetChecksumAsync(this Solution solution, CancellationToken cancellationToken) => new UnitTestingChecksumWrapper(await solution.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false)); - - [Obsolete("Use GetChecksumAsync instead")] - public static UnitTestingSolutionStateWrapper GetState(this Solution solution) - => new UnitTestingSolutionStateWrapper(solution.State); } } diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionStateWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionStateWrapper.cs deleted file mode 100644 index edead76983905..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSolutionStateWrapper.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingSolutionStateWrapper - { - internal SolutionState UnderlyingObject { get; } - - public UnitTestingSolutionStateWrapper(SolutionState underlyingObject) - => UnderlyingObject = underlyingObject ?? throw new ArgumentNullException(nameof(underlyingObject)); - - public async Task GetChecksumAsync(CancellationToken cancellationToken) - { - var checksum = await UnderlyingObject.GetChecksumAsync(cancellationToken).ConfigureAwait(false); - return new UnitTestingChecksumWrapper(checksum); - } - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolExtensions.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolExtensions.cs index bdeba4fb61539..db5b4defb739a 100644 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolExtensions.cs @@ -11,10 +11,6 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api { internal static class UnitTestingSymbolExtensions { - [Obsolete("Use GetSymbolKeyString instead")] - public static UnitTestingSymbolKeyWrapper GetSymbolKey(this ISymbol symbol, CancellationToken cancellationToken) - => new UnitTestingSymbolKeyWrapper(SymbolKeyExtensions.GetSymbolKey(symbol, cancellationToken)); - public static string GetSymbolKeyString(this ISymbol symbol, CancellationToken cancellationToken) => SymbolKey.Create(symbol, cancellationToken).ToString(); diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolKeyWrapper.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolKeyWrapper.cs deleted file mode 100644 index 1a5dbf2728734..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingSymbolKeyWrapper.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingSymbolKeyWrapper - { - internal SymbolKey UnderlyingObject { get; } - - public UnitTestingSymbolKeyWrapper(SymbolKey underlyingObject) - => UnderlyingObject = underlyingObject; - - public override string ToString() - => UnderlyingObject.ToString(); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs deleted file mode 100644 index f90a736e114ea..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/Api/UnitTestingWorkspaceExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal static class UnitTestingWorkspaceExtensions - { - public static async Task TryGetUnitTestingRemoteHostClientWrapperAsync(this Workspace workspace, CancellationToken cancellationToken) - { - var client = await RemoteHostClient.TryGetClientAsync(workspace, cancellationToken).ConfigureAwait(false); - return new UnitTestingRemoteHostClientWrapper(client); - } - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessor.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessor.cs deleted file mode 100644 index 3bdaf97ead635..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using Microsoft.CodeAnalysis.Experiments; -using Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api; -using Microsoft.CodeAnalysis.Host.Mef; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting -{ - [Obsolete] - internal sealed class UnitTestingExperimentationServiceAccessor : IUnitTestingExperimentationServiceAccessor - { - private readonly IExperimentationService _experimentationService; - - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public UnitTestingExperimentationServiceAccessor(IExperimentationService experimentationService) - => _experimentationService = experimentationService; - - public bool IsExperimentEnabled(string experimentName) - => _experimentationService.IsExperimentEnabled(experimentName); - } -} diff --git a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessorFactory.cs b/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessorFactory.cs deleted file mode 100644 index b0da95879ab03..0000000000000 --- a/src/Workspaces/Core/Portable/ExternalAccess/UnitTesting/UnitTestingExperimentationServiceAccessorFactory.cs +++ /dev/null @@ -1,30 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using System.Composition; -using Microsoft.CodeAnalysis.Experiments; -using Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api; -using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Host.Mef; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting -{ - [Obsolete] - [ExportWorkspaceServiceFactory(typeof(IUnitTestingExperimentationServiceAccessor))] - [Shared] - internal class UnitTestingExperimentationServiceAccessorFactory : IWorkspaceServiceFactory - { - [ImportingConstructor] - [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] - public UnitTestingExperimentationServiceAccessorFactory() { } - - [Obsolete(MefConstruction.FactoryMethodMessage, error: true)] - public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) - { - var experimentationService = workspaceServices.GetRequiredService(); - return new UnitTestingExperimentationServiceAccessor(experimentationService); - } - } -} diff --git a/src/Workspaces/Remote/Core/ExternalAccess/UnitTesting/Api/UnitTestingAssetStorageWrapper.cs b/src/Workspaces/Remote/Core/ExternalAccess/UnitTesting/Api/UnitTestingAssetStorageWrapper.cs deleted file mode 100644 index 21f543a4fb4a4..0000000000000 --- a/src/Workspaces/Remote/Core/ExternalAccess/UnitTesting/Api/UnitTestingAssetStorageWrapper.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingAssetStorageWrappper - { - public static UnitTestingAssetStorageWrappper Instance { get; } = new UnitTestingAssetStorageWrappper(AssetStorage.Default); - - internal AssetStorage UnderlyingObject { get; } - - internal UnitTestingAssetStorageWrappper(AssetStorage underlyingObject) - => UnderlyingObject = underlyingObject ?? throw new ArgumentNullException(nameof(underlyingObject)); - - public void UpdateLastActivityTime() - => UnderlyingObject.UpdateLastActivityTime(); - } -} diff --git a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingPinnedSolutionInfoWrapper.cs b/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingPinnedSolutionInfoWrapper.cs deleted file mode 100644 index f1450cef45a50..0000000000000 --- a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingPinnedSolutionInfoWrapper.cs +++ /dev/null @@ -1,29 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using Microsoft.CodeAnalysis.Remote; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingPinnedSolutionInfoWrapper - { - /// - /// Because PinnedSolutionInfo is internal, and it is directly passed into the callee in - /// - /// the type of has to be object. Its runtime type is . - /// - public UnitTestingPinnedSolutionInfoWrapper(object underlyingObject) - { - var reader = ((JObject)underlyingObject).CreateReader(); - var serializer = JsonSerializer.Create(new JsonSerializerSettings() { Converters = new[] { AggregateJsonConverter.Instance } }); - UnderlyingObject = serializer.Deserialize(reader); - } - - internal PinnedSolutionInfo UnderlyingObject { get; } - } -} diff --git a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingRoslynServicesWrapper.cs b/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingRoslynServicesWrapper.cs deleted file mode 100644 index be7bdb32e4c58..0000000000000 --- a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingRoslynServicesWrapper.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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 file in the project root for more information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Remote; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal readonly struct UnitTestingRoslynServicesWrapper - { - private readonly SolutionService _solutionService; - - public UnitTestingRoslynServicesWrapper(UnitTestingPinnedSolutionInfoWrapper pinnedSolutionInfoWrapper, UnitTestingAssetStorageWrappper assetStorageWrappper) - => _solutionService = new SolutionService(SolutionService.CreateAssetProvider(pinnedSolutionInfoWrapper.UnderlyingObject, assetStorageWrappper.UnderlyingObject)); - - public Task GetSolutionAsync(UnitTestingPinnedSolutionInfoWrapper pinnedSolutionInfoWrapper, CancellationToken cancellationToken) - => _solutionService.GetSolutionAsync(pinnedSolutionInfoWrapper.UnderlyingObject.SolutionChecksum, cancellationToken); - } -} diff --git a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingStreamExtensions.cs b/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingStreamExtensions.cs deleted file mode 100644 index 450018243a7c2..0000000000000 --- a/src/Workspaces/Remote/ServiceHub/ExternalAccess/UnitTesting/Api/UnitTestingStreamExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// 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 file in the project root for more information. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using Microsoft.CodeAnalysis.Remote; -using Roslyn.Utilities; -using StreamJsonRpc; - -namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api -{ - [Obsolete] - internal static class UnitTestingStreamExtensions - { - public static JsonRpc UnitTesting_CreateStreamJsonRpc( - this Stream stream, - object? target, - TraceSource logger, - IEnumerable? jsonConverters = null) - { - jsonConverters ??= SpecializedCollections.EmptyEnumerable(); - - var jsonFormatter = new JsonMessageFormatter(); - jsonFormatter.JsonSerializer.Converters.AddRange(jsonConverters.Concat(AggregateJsonConverter.Instance)); - - return new JsonRpc(new HeaderDelimitedMessageHandler(stream, jsonFormatter), target) - { - CancelLocallyInvokedMethodsWhenConnectionIsClosed = true, - TraceSource = logger - }; - } - } -}