提交 3a37ed27 编写于 作者: M Manish Vasani 提交者: GitHub

Revert "Hookup non-Roslyn view to the document tracking service on a foregrou…" (#15188)

上级 2e14171f
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using System.Threading; using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.VisualStudio.LanguageServices.Implementation; using Microsoft.VisualStudio.LanguageServices.Implementation;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem; using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Text.Editor;
using Roslyn.Utilities; using Microsoft.VisualStudio.TextManager.Interop;
namespace Microsoft.VisualStudio.LanguageServices namespace Microsoft.VisualStudio.LanguageServices
{ {
...@@ -41,15 +40,11 @@ protected override void OnBeforeNonRoslynDocumentWindowShow(IVsWindowFrame frame ...@@ -41,15 +40,11 @@ protected override void OnBeforeNonRoslynDocumentWindowShow(IVsWindowFrame frame
return; return;
} }
// Schedule hookup of the non-Roslyn document view on foreground task scheduler. var view = GetTextViewFromFrame(frame);
Task.Factory.SafeStartNew(() => if (view != null)
{ {
var view = GetTextViewFromFrame(frame); _documentTrackingService?.OnNonRoslynViewOpened(view);
if (view != null) }
{
_documentTrackingService?.OnNonRoslynViewOpened(view);
}
}, CancellationToken.None, ForegroundTaskScheduler);
} }
private ITextView GetTextViewFromFrame(IVsWindowFrame frame) private ITextView GetTextViewFromFrame(IVsWindowFrame frame)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册