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

Conversation

@jcansdale
Copy link
Collaborator

@jcansdale 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

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 [wip] Consistently name all commands Consistently name all VS commands May 2, 2018
@jcansdale jcansdale requested a review from meaghanlewis May 2, 2018 14:56
Copy link
Contributor

@meaghanlewis meaghanlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

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
Copy link
Contributor

grokys commented May 3, 2018

This will also help with #1637 right?

@grokys grokys merged commit f09510e into master May 3, 2018
@grokys grokys deleted the fixes/1630-name-commands-consistently branch May 3, 2018 08:47
@jcansdale jcansdale mentioned this pull request May 4, 2018
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audit and cleanup named commands exposed by GitHub for Visual Studio

4 participants