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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently name all VS commands #1638

Merged
merged 1 commit into from May 3, 2018

Conversation

Projects
None yet
3 participants
@jcansdale
Contributor

jcansdale commented May 2, 2018

This PR uses a tip shared by @madskristensen to ensure that all commands have a consistent name.
https://twitter.com/jcansdale/status/991013150932729856
https://twitter.com/mkristensen/status/991018416222818306

Ahh, there is a way and it is undocumented. Prefix the name in the .vsct file with a period. Eg: .TestDriven.NET.Foo

What this PR does

Previously our commands would appear on the shortcuts search dialog with inconsistent prefixes (some didn't even contain GitHub and were difficult to find).

image

  • This PR gives them all a consistent prefix of GitHub.

image

  • Specify a CanonicalName for all commands (this is used in the Command Window)

  • Specify a LocCanonicalName for all commands (used in Customize > Keyboard... dialog)

  • Our commands now appear as follows

GitHub.Back
GitHub.Forward
GitHub.Refresh
GitHub.PullRequests
GitHub.ViewOnGitHub
GitHub.Help
GitHub.ConnectToGitHub
GitHub.ShowGitHubPane
GitHub.ShowCurrentPullRequest
GitHub.OpenLink
GitHub.CopyLink
GitHub.OpenFileInSolution
GitHub.Blame
GitHub.CreateGist
GitHub.NextComment
GitHub.PreviousComment

Previously they appeared as in the screenshot above + the following:

EditorContextMenus.CodeWindow.OpenFileinSolution
Edit.NextComment
Edit.PreviousComment

Reviewers

This PR is deliberately being kept simple. Is there any reason not to do this? 馃槈

I hope having all of these commands consistently named will allow for faster and more stable automation testing. //paging @meaghanlewis

How to test

These commands names are surfaced in a few places

  1. On the Command Window if you start typing GitHub.

image

  1. Right-click on a toolbar, Customize..., Keyboard... and start typing GitHub in Show commands containing.

image

  1. They can also be accessed programatically via automation.
        void ShowGitHubPane(DTE dte)
        {
            dte.ExecuteCommand("GitHub.ShowGitHubPane");
        }

Future PRs

There is a bunch of functionality that is not being exposed as VS commands (e.g. show PR list of sync submodules). We should fix this but in separate PRs.

Fixes #1630

Consistently name all commands
Name all commands using a `GitHub.` prefix.
Give commands both a CanonicalName and a LocCanonicalName (for the
keyboard shortcuts dialog).

@jcansdale jcansdale changed the title from [wip] Consistently name all commands to Consistently name all VS commands May 2, 2018

@jcansdale jcansdale requested a review from meaghanlewis May 2, 2018

@meaghanlewis

Thanks for doing this @jcansdale. It will be great to have these extra commands!

@grokys

grokys approved these changes May 3, 2018

LGTM! I did notice that some commands don't seem to do anything when run from the command window, such as GitHub.Help, though I don't think that's an issue with this PR.

@grokys

This comment has been minimized.

Contributor

grokys commented May 3, 2018

This will also help with #1637 right?

@grokys grokys merged commit f09510e into master May 3, 2018

2 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@grokys grokys deleted the fixes/1630-name-commands-consistently branch May 3, 2018

@jcansdale jcansdale referenced this pull request May 4, 2018

Merged

GitHub fork beta functionality #1607

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment