-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Followup work to handle ForegroundThreadAffinitizedObject removal. #73049
Followup work to handle ForegroundThreadAffinitizedObject removal. #73049
Conversation
@@ -146,75 +146,15 @@ private static string GetFixCategory(DiagnosticSeverity severity) | |||
throw new NotImplementedException($"We implement {nameof(GetSuggestedActionCategoriesAsync)}. This should not be called."); | |||
} | |||
|
|||
private async Task<TextSpan?> GetSpanAsync(ReferenceCountedDisposable<State> state, SnapshotSpan range, CancellationToken cancellationToken) |
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 was some overwrought code to get the user's selection. inlined to callsite.
await _threadingContext.InvokeBelowInputPriorityAsync(() => | ||
{ | ||
// Make sure we were not disposed between kicking off this work and getting to this point. | ||
using var state = _state.TryAddReference(); |
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.
@sharwell it feels like this was unnecessary (and was not ported to callsite). taht code already is holding onto the state
in a local, so the ref count can't go away while we're switching to teh UI to get the selection.
@@ -70,7 +70,7 @@ private partial class SuggestedActionsSource : IAsyncSuggestedActionsSource | |||
CancellationToken cancellationToken) | |||
{ | |||
_threadingContext.ThrowIfNotOnUIThread(); | |||
using var state = SourceState.TryAddReference(); | |||
using var state = _state.TryAddReference(); |
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.
remove this property that did nothing more than return the state.
|
||
private static string GetFixCategory(DiagnosticSeverity severity) |
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.
called in only one location. inlined.
{ | ||
using var state = _state.TryAddReference(); |
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.
no need to grab this again. it can be passed in.
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
@@ -140,6 +140,21 @@ void FireEventsForDocument(DocumentId documentId) | |||
codeModel.FireEvents(); | |||
return; | |||
} | |||
|
|||
// Returns true if any keyboard or mouse button input is pending on the message queue. | |||
static bool IsInputPending() |
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.
only called here. moved to this location.
@sharwell this is ready for review. |
@sharwell ptal. |
@sharwell ptal |
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
Outdated
Show resolved
Hide resolved
@jasonmalinowski For review when you get back. |
Fixes #73048.
Followup to #73029.