Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFactor sync submodules into VS command #1642
Conversation
Extract the sync submodules action into a VS command called GitHub.SyncSubmodules.
|
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); |
This comment has been minimized.
This comment has been minimized.
grokys
May 3, 2018
Contributor
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?
This comment has been minimized.
This comment has been minimized.
jcansdale
May 3, 2018
Author
Collaborator
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).
jcansdale commentedMay 2, 2018
What this PR does
GitHub.SyncSubmodulesReviewers
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