-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Move to the platform's implementation of the BackgroundWorkIndicator service. #78473
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
Conversation
| this, textView, applicableToSpan, description, | ||
| cancelOnEdit, cancelOnFocusLost); | ||
|
|
||
| // Then add a single scope representing the how the UI should look initially. |
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.
note: this 'AddScope' was pushed into the constructor.
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; |
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.
this file is effectively a rewrite. I would look at the SxS view, not hte inline view. And really just pay attention to how the new code is written.
| @@ -1,89 +1,104 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
| // The .NET Foundation licenses this file to you under the MIT license. | |||
| // See the LICENSE file in the project root for more information. | |||
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.
this file is effectively a rewrite. I would look at the SxS view, not hte inline view. And really just pay attention to how the new code is written.
src/EditorFeatures/Core/BackgroundWorkIndicator/WpfBackgroundWorkIndicatorFactory.cs
Show resolved
Hide resolved
src/EditorFeatures/Core/BackgroundWorkIndicator/WpfBackgroundWorkIndicatorFactory.cs
Show resolved
Hide resolved
| // use the description of the last scope if we have one. We don't have enough room to show all | ||
| // the descriptions at once. | ||
| lock (this.ContextAndScopeDataMutationGate) | ||
| return _scopes_onlyAccessUnderLock.LastOrDefault()?.Description ?? _firstDescription; |
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.
added comment. basically, there is always an implicit scope the platform holds onto which holds onto that first description. they just don't expose it. so this is how we simulate deferring to them.
| public void TakeOwnership() | ||
| => this.Dispose(); | ||
|
|
||
| public IUIThreadOperationScope AddScope(bool allowCancellation, string description) |
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.
sure. basically, the reason is simply that when a scope is created, it has no progress (it's effective 0 completed of 0 total). So it would have no impact on any progress display. happy to comment that.
ToddGrun
left a comment
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 don't think you need to change anything, but just wanted to clarify the platform can have multiple BWI indicators active. I don't think that helps any Roslyn scenarios I can think of, but it's available if helpful. |
|
Understood. We've decided against that for our UX experiences :) |
Followup to #78469.
We need to wait on https://devdiv.visualstudio.com/DevDiv/_git/VSEditor/pullrequest/634844 making it into a public preview to take this.