Simplify initialization of OpenFileTracker#79281
Conversation
| var solutionClosingContext = UIContext.FromUIContextGuid(VSConstants.UICONTEXT.SolutionClosing_guid); | ||
| solutionClosingContext.UIContextChanged += (_, e) => ProjectSystemProjectFactory.SolutionClosing = e.Activated; | ||
|
|
||
| var openFileTracker = await OpenFileTracker.CreateAsync(this, ProjectSystemProjectFactory, asyncServiceProvider).ConfigureAwait(true); |
There was a problem hiding this comment.
There was a problem hiding this comment.
Oh, maybe getting the telemetry session is still potentially costly
There was a problem hiding this comment.
That's a pretty old dependency, might be worth checking whether that still needs to happen on the ui thread
There was a problem hiding this comment.
And @davkean confirmed the session is created really early during VS startup, so no worries about it.
There was a problem hiding this comment.
Nice! Is the yielding on the main thread switch still worthwhile then?
There was a problem hiding this comment.
I'm leaving it, since once this is in, I'm doing a follow-up to delete the initialize method entirely since the only remaining work would be the UIContext stuff which doesn't need the UI thread anymore either.
c8cbf5b to
7051de1
Compare
There's only two things here that could potentially need the UI thread: 1. The Running Document Table subscription, but OpenTextBufferProvider already abstracted that away. 2. The IEditorOptionsFactoryService usage, which being a MEF component shouldn't care, but even then we don't need it right away. It's easy to clean all this up, so just do so.
7051de1 to
2193401
Compare
There's only two things here that could potentially need the UI thread:
It's easy to clean all this up, so just do so.