-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Simplify initialization of OpenFileTracker #79281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Simplify initialization of OpenFileTracker #79281
Conversation
_isExternalErrorDiagnosticUpdateSourceSubscribedToSolutionBuildEvents = true; | ||
} | ||
|
||
public async Task InitializeUIAffinitizedServicesAsync(IAsyncServiceProvider asyncServiceProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, maybe getting the telemetry session is still potentially costly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ahead of you! #79282
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And @davkean confirmed the session is created really early during VS startup, so no worries about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Is the yielding on the main thread switch still worthwhile then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
619ee89
to
c8cbf5b
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.
c8cbf5b
to
7051de1
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.