-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Break code for handling a request to FindRefs/GoToBase/GoToImpl out of the editor command handlers for those features. #78751
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
Break code for handling a request to FindRefs/GoToBase/GoToImpl out of the editor command handlers for those features. #78751
Conversation
|
|
||
| internal abstract class AbstractGoOrFindCommandHandler<TCommandArgs>( | ||
| IGoOrFindNavigationService navigationService) : ICommandHandler<TCommandArgs> | ||
| where TCommandArgs : EditorCommandArgs |
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.
base command handler for GoToBase/GoToImpl/FindRefs.
defers most operations to the provided IGoOrFindNavigationService passed in.
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 type basically jsut bridges from from the ICommandHandler/TCommandArgs world to the core roslyn world.
| /// Core service responsible for handling an operation (like 'go to base, go to impl, find references') | ||
| /// and trying to navigate quickly to them if possible, or show their results in the find-usages window. | ||
| /// </summary> | ||
| internal abstract class AbstractGoOrFindNavigationService<TLanguageService>( |
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.
the core code for the absstract handler was broken out into this abstract service. This service has no command-handler dependencies (though it does have eidtor dependencies) and thus can be used simply by the SolutionExplorer rewrite i'm in the middle of.
| [method: ImportingConstructor] | ||
| [method: SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")] | ||
| internal sealed class FindReferencesCommandHandler(FindReferencesNavigationService navigationService) | ||
| : AbstractGoOrFindCommandHandler<FindReferencesCommandArgs>(navigationService); |
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.
the command handler is now trivial. it just pulls in the appropriate service and defers to it.
| /// this source. | ||
| /// </remarks> | ||
| private readonly CancellationSeries _cancellationSeries = new(threadingContext.DisposalToken); | ||
| private CancellationTokenSource _cancellationTokenSource = new(); |
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 restored this to the original logic. it's acutaly subtly different from a cancellation series in a way i didn't realize.
Followup to #78750.
Will be part of the work to get us off progression.