Skip to content

Commit

Permalink
Merge pull request #74084 from sharwell/async-provider
Browse files Browse the repository at this point in the history
Create new AsyncServiceProvider instead of using AsyncServiceProvider.GlobalProvider
  • Loading branch information
sharwell authored Jun 20, 2024
2 parents 8085c11 + 43d02af commit 8bdf5c4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
using Roslyn.VisualStudio.NewIntegrationTests.InProcess;
using WindowsInput.Native;
using Xunit;
using COMAsyncServiceProvider = Microsoft.VisualStudio.Shell.Interop.COMAsyncServiceProvider;
using IComponentModel = Microsoft.VisualStudio.ComponentModelHost.IComponentModel;
using IObjectWithSite = Microsoft.VisualStudio.OLE.Interop.IObjectWithSite;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
Expand Down Expand Up @@ -455,7 +456,7 @@ public async Task<ImmutableArray<string>> GetF1KeywordsAsync(CancellationToken c
ErrorHandler.ThrowOnFailure(vsView.GetBuffer(out var textLines));
ErrorHandler.ThrowOnFailure(textLines.GetLanguageServiceID(out var languageServiceGuid));

var languageService = await ((AsyncServiceProvider)AsyncServiceProvider.GlobalProvider).QueryServiceAsync(languageServiceGuid).WithCancellation(cancellationToken);
var languageService = await new AsyncServiceProvider((COMAsyncServiceProvider.IAsyncServiceProvider)AsyncServiceProvider.GlobalProvider).QueryServiceAsync(languageServiceGuid).WithCancellation(cancellationToken);
Assumes.Present(languageService);

var languageContextProvider = (IVsLanguageContextProvider)languageService;
Expand Down

0 comments on commit 8bdf5c4

Please sign in to comment.