Add comment to describe why IVsRunningDocumentTable retrievel is deferred

This commit is contained in:
Dustin Campbell 2024-03-26 11:39:50 -07:00
Родитель 9e109f88a7
Коммит 956e9dbddd
1 изменённых файлов: 2 добавлений и 0 удалений

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

@ -226,6 +226,8 @@ internal sealed class VisualStudioEditorDocumentManager(
{
JoinableTaskContext.AssertUIThread();
// Note: Because it is a COM interface, we defer retrieving IVsRunningDocumentTable until
// now to avoid implicitly marshalling to the UI thread, which can deadlock.
_runningDocumentTable ??= _serviceProvider.GetService<SVsRunningDocumentTable, IVsRunningDocumentTable4>(throwOnFailure: true).AssumeNotNull();
if (!_advised)