提交 7e343fb5 编写于 作者: S Sam Harwell

Install the VSSDK analyzers in VSIX package projects and fix diagnostics

上级 8ac69849
......@@ -35,6 +35,11 @@
<_NETCoreSdkIsPreview>false</_NETCoreSdkIsPreview>
</PropertyGroup>
<!-- Settings for Visual Studio packages -->
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK.Analyzers" Version="$(MicrosoftVisualStudioSDKAnalyzersVersion)" PrivateAssets="all" Condition="'$(RoslynProjectType)' == 'Vsix'" />
</ItemGroup>
<!-- Settings for localization -->
<ItemGroup>
<PackageReference Include="XliffTasks" Version="$(XliffTasksVersion)" PrivateAssets="All" Condition="'$(NonShipping)' != 'true'" />
......
......@@ -101,6 +101,7 @@
<MicrosoftVisualStudioProjectSystemManagedVersion>2.3.6152103</MicrosoftVisualStudioProjectSystemManagedVersion>
<MicrosoftVisualStudioQualityToolsUnitTestFrameworkVersion>10.0.0.0-alpha</MicrosoftVisualStudioQualityToolsUnitTestFrameworkVersion>
<MicrosoftVisualStudioRemoteControlVersion>14.0.249-master2E2DC10C</MicrosoftVisualStudioRemoteControlVersion>
<MicrosoftVisualStudioSDKAnalyzersVersion>15.7.7</MicrosoftVisualStudioSDKAnalyzersVersion>
<MicrosoftVisualStudioSetupConfigurationInteropVersion>1.15.103</MicrosoftVisualStudioSetupConfigurationInteropVersion>
<MicrosoftVisualStudioSettings140Version>14.3.25407</MicrosoftVisualStudioSettings140Version>
<MicrosoftVisualStudioShell140Version>14.3.25407</MicrosoftVisualStudioShell140Version>
......
......@@ -12,6 +12,7 @@
using Microsoft.VisualStudio.LanguageServices;
using Microsoft.VisualStudio.LanguageServices.Implementation;
using Microsoft.VisualStudio.LanguageServices.Implementation.Options;
using ThreadHelper = Microsoft.VisualStudio.Shell.ThreadHelper;
namespace Roslyn.VisualStudio.DiagnosticsWindow.OptionsPages
{
......@@ -47,7 +48,7 @@ protected override void OnApply(PageApplyEventArgs e)
SetRoslynLogger(loggerTypes, () => new TraceLogger(options));
// second set RemoteHost options
var client = _remoteHostClientService.TryGetRemoteHostClientAsync(CancellationToken.None).Result;
var client = ThreadHelper.JoinableTaskFactory.Run(() => _remoteHostClientService.TryGetRemoteHostClientAsync(CancellationToken.None));
if (client == null)
{
// Remote host is disabled
......@@ -55,11 +56,11 @@ protected override void OnApply(PageApplyEventArgs e)
}
var functionIds = GetFunctionIds(options).ToList();
var unused = client.TryRunRemoteAsync(
_ = ThreadHelper.JoinableTaskFactory.Run(() => client.TryRunRemoteAsync(
WellKnownRemoteHostServices.RemoteHostService,
nameof(IRemoteHostService.SetLoggingFunctionIds),
new object[] { loggerTypes, functionIds },
CancellationToken.None).Result;
CancellationToken.None));
}
private static IEnumerable<string> GetFunctionIds(Func<FunctionId, bool> options)
......
......@@ -55,6 +55,8 @@ public sealed class VisualStudioDiagnosticsWindowPackage : AsyncPackage
/// </summary>
private void ShowToolWindow(object sender, EventArgs e)
{
ThreadHelper.ThrowIfNotOnUIThread();
// Get the instance number 0 of this tool window. This window is single instance so this instance
// is actually the only one.
// The last flag is set to true so that if the tool window does not exists it will be created.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册