Skip to content

Commit

Permalink
Remove workaround for 16.10p2 now that 16.10 has shipped
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed May 28, 2021
1 parent a86dbfb commit 2ac5b31
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,7 @@ internal static async Task<ILanguageServerTarget> CreateAsync(
var jsonRpc = new JsonRpc(new HeaderDelimitedMessageHandler(outputStream, inputStream, jsonMessageFormatter));
var serverTypeName = languageClient.GetType().Name;

LogHubLspLogger? logger = null;
// In 16.10 preview 2 LogHub moved to MS.VS.Utilities and MS.VS.RpcContracts and the old assembly was removed.
// To allow LSP integration tests to run on 16.10 preview 1, we only setup the loghub
// logger if the MS.VS.Utilities assembly contains the LogHub types.
// FeatureFlags.IFeatureFlags is a known type in the MS.VS.Utilities assembly.
// Removal tracked by https://github.com/dotnet/roslyn/issues/52454
var traceConfigurationType = typeof(FeatureFlags.IFeatureFlags).Assembly.GetType("Microsoft.VisualStudio.LogHub.TraceConfiguration", throwOnError: false);
if (traceConfigurationType != null)
{
logger = await CreateLoggerAsync(asyncServiceProvider, serverTypeName, clientName, jsonRpc, cancellationToken).ConfigureAwait(false);
}
var logger = await CreateLoggerAsync(asyncServiceProvider, serverTypeName, clientName, jsonRpc, cancellationToken).ConfigureAwait(false);

var server = languageClient.Create(
jsonRpc,
Expand All @@ -220,10 +210,6 @@ internal static async Task<ILanguageServerTarget> CreateAsync(
return server;
}

// Make sure this isn't inlined so these types are only loaded
// after the type check in CreateAsync.
// Removal tracked by https://github.com/dotnet/roslyn/issues/52454
[MethodImpl(MethodImplOptions.NoInlining)]
private static async Task<LogHubLspLogger?> CreateLoggerAsync(
VSShell.IAsyncServiceProvider? asyncServiceProvider,
string serverTypeName,
Expand Down

0 comments on commit 2ac5b31

Please sign in to comment.