Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Followup to #78750.

Will be part of the work to get us off progression.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 29, 2025 14:08
@CyrusNajmabadi CyrusNajmabadi marked this pull request as draft May 29, 2025 14:08

internal abstract class AbstractGoOrFindCommandHandler<TCommandArgs>(
IGoOrFindNavigationService navigationService) : ICommandHandler<TCommandArgs>
where TCommandArgs : EditorCommandArgs
Copy link
Member Author

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.

Copy link
Member Author

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>(
Copy link
Member Author

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);
Copy link
Member Author

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.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review May 29, 2025 18:36
@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski @JoeRobich @dibarbet ptal.

@CyrusNajmabadi CyrusNajmabadi requested a review from JoeRobich May 29, 2025 18:51
/// this source.
/// </remarks>
private readonly CancellationSeries _cancellationSeries = new(threadingContext.DisposalToken);
private CancellationTokenSource _cancellationTokenSource = new();
Copy link
Member Author

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.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge May 29, 2025 20:35
@CyrusNajmabadi CyrusNajmabadi merged commit 241d91b into dotnet:main May 29, 2025
24 of 25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the separateCommandHandler branch May 29, 2025 21:44
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 29, 2025
@RikkiGibson RikkiGibson removed this from the Next milestone Aug 19, 2025
@RikkiGibson RikkiGibson added this to the 18.0 P1 milestone Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants