Workaround breaking change to allow LSP integration tests to run on 16.10p1#52456
Merged
dibarbet merged 3 commits intodotnet:main-vs-depsfrom Apr 7, 2021
Merged
Conversation
…to run on 16.10p1
dibarbet
commented
Apr 7, 2021
| // 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. | ||
| var traceConfigurationType = typeof(FeatureFlags.IFeatureFlags).Assembly.GetType("Microsoft.VisualStudio.LogHub.TraceConfiguration", throwOnError: false); |
| 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); |
Member
There was a problem hiding this comment.
Does CreateLoggerAsync need to be marked as no-inline to avoid causing any type load issues? Or is LogHubLspLogger defined somewhere else?
Member
Author
There was a problem hiding this comment.
Hmm not sure! LogHubLspLogger is our own (not problematic) logger type so everything that is a problem is entirely contained within CreateLoggerAsync if that makes a difference
src/VisualStudio/Core/Def/Implementation/LanguageClient/InProcLanguageServer.cs
Show resolved
Hide resolved
jasonmalinowski
approved these changes
Apr 7, 2021
| // 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)] |
Member
There was a problem hiding this comment.
And I'll say: the CLR has a bunch of rules about what it does and doesn't inline, so I presume this won't inline no matter what. But better to be explicit, and the NoInlining pattern is common enough around dealing with potentially missing types that it makes it a bit more clear what we're doing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #52454
The loghub types moved in 16.10p2 to different assemblies and namespaces (the old assembly was removed). We reacted to this change in main-vs-deps, but this caused the LSP integration tests to fail server activation. The main-vs-deps code could not find the new types in 16.10p1 since 16.10p1 is still on the old assembly.
Workaround by not creating the LSP logger when the new types are missing. This should be removed when the integration test queue updates to 16.10p2.