Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Factor sync submodules into VS command #1642

Merged
merged 5 commits into from
May 4, 2018

Conversation

jcansdale
Copy link
Collaborator

What this PR does

  • Extract the sync submodules action into a VS command called
    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

Extract the sync submodules action into a VS command called
GitHub.SyncSubmodules.
Copy link
Contributor

@grokys grokys left a 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);
Copy link
Contributor

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?

Copy link
Collaborator Author

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).

grokys
grokys previously approved these changes May 3, 2018
@jcansdale jcansdale merged commit a3aca21 into master May 4, 2018
@jcansdale jcansdale deleted the refactor/sync-submodules-vs-command branch May 4, 2018 09:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants