提交 854772f9 编写于 作者: S Sam Harwell

Ensure the compiler package is loaded for integration tests

上级 42ef261b
......@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using EnvDTE;
......@@ -16,6 +17,7 @@ namespace Roslyn.Compilers.Extension
{
[ProvideAutoLoad(UIContextGuids.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[Guid("31C0675E-87A4-4061-A0DD-A4E510FCCF97")]
public sealed class CompilerPackage : AsyncPackage
{
public static string RoslynHive = null;
......
......@@ -16,12 +16,21 @@ namespace Microsoft.VisualStudio.IntegrationTest.Setup
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
public sealed class IntegrationTestServicePackage : AsyncPackage
{
private static readonly Guid s_compilerPackage = new Guid("31C0675E-87A4-4061-A0DD-A4E510FCCF97");
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true);
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
cancellationToken.ThrowIfCancellationRequested();
var shell = (IVsShell)await GetServiceAsync(typeof(SVsShell));
ErrorHandler.ThrowOnFailure(shell.IsPackageInstalled(s_compilerPackage, out var installed));
if (installed != 0)
{
await ((IVsShell7)shell).LoadPackageAsync(s_compilerPackage);
}
IntegrationTestServiceCommands.Initialize(this);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册