Revert "Call AdviseRunningDocTableEvents on UI thread. (#5783)" (#5832)

This reverts commit 1f785f416c.
This commit is contained in:
N. Taylor Mullen 2021-12-06 16:33:59 -08:00
Родитель 44a883ac09
Коммит 51d34f58a8
1 изменённых файлов: 2 добавлений и 8 удалений

Просмотреть файл

@ -52,14 +52,8 @@ namespace Microsoft.VisualStudio.Editor.Razor.Documents
_runningDocumentTable = (IVsRunningDocumentTable4)runningDocumentTable;
_editorAdaptersFactory = editorAdaptersFactory;
// Need to grab running doc-table events but that requires the UI thread.
joinableTaskContext.Factory.Run(async () =>
{
await joinableTaskContext.Factory.SwitchToMainThreadAsync();
var hr = runningDocumentTable.AdviseRunningDocTableEvents(new RunningDocumentTableEventSink(this), out _);
Marshal.ThrowExceptionForHR(hr);
});
var hr = runningDocumentTable.AdviseRunningDocTableEvents(new RunningDocumentTableEventSink(this), out _);
Marshal.ThrowExceptionForHR(hr);
_documentsByCookie = new Dictionary<uint, List<DocumentKey>>();
_cookiesByDocument = new Dictionary<DocumentKey, uint>();