-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Factor sync submodules into VS command #1642
Conversation
Extract the sync submodules action into a VS command called GitHub.SyncSubmodules.
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.
Looks good, and seems to work well. This could be very handy. Just one question.
|
||
if (!complete) | ||
{ | ||
statusBarNotificationService.ShowMessage("Failed to sync submodules." + Environment.NewLine + writer); |
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.
Is it normal for VS commands to write directly to the status bar? Is there no concept of "output" for commands, which e.g. shows in the command pane?
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 think the status bar is what commands tend to use as their ambient UI. There isn't really any concept of a native UI or output for a command.
One possibility would be to pass in a progress object that the command could report back to. This could also sidestep the issue of returning results.
I wanted to start off with a simple refactoring and and avoid any extra implementation detail. We can revisit next time this command is touched (if we decide to surface it somewhere else).
What this PR does
GitHub.SyncSubmodules
Reviewers
I've extended the command interface to include a method that returns results from the command. Is this a reasonable thing to do if results are sometimes required from a command? It can also be used standalone without returning any results.
https://github.com/github/VisualStudio/blob/36e680e5a0cd936cafbd27af658335727d28841c/src/GitHub.Exports/Commands/ISyncSubmodulesCommand.cs#L16
Related to #1638