创建 Visual Studio 扩展以将项目添加到 Git 历史记录页面 [英] Create Visual Studio extension to add item to Git History page

查看:13
本文介绍了创建 Visual Studio 扩展以将项目添加到 Git 历史记录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建 Visual Studio 2019 扩展.单击历史记录中的提交时,我想在上下文菜单中添加一个附加选项.然后从那里我想获取在该提交之前和之后更改的文件的快照.我无法将按钮添加到上下文菜单中.

I'm working on trying to create a Visual Studio 2019 extension. I'd like to add an additional option to the context menu when clicking on a commit in the history. Then from there I'd like to grab a snapshot of the files that were changed in that commit both before and after. I'm having trouble getting the button added to the context menu.

我已经安装了命令资源管理器并且能够找到对上下文菜单的引用.

I've installed the Command Explorer and was able to find the reference to the context menu.

但是,当我在我的 .vsct 文件中添加对它的引用时,它找不到它.

However, when I add a reference to it in my .vsct file it can't find it.

<Group guid="guidSubmitVulnerabilityCmdSet" id="GitMenu" priority="0x0600">
        <Parent guid="PackageCommandSetGuid" id="GitHistory_ContextMenu" />
      </Group>

我想我需要添加一个引用正确头文件的 Extern 元素,但是我在我的系统上找不到任何包含这些值的 .h 文件.我还尝试在对象资源管理器中查看 Microsoft.TeamFoundation.Git.Provider.dll 程序集,但没有看到任何有希望的东西.

I figured I needed to add an Extern element with a reference to the proper header file, but I can't find any .h file on my system that contains these values. I've also tried looking through the Microsoft.TeamFoundation.Git.Provider.dll assembly in the Object Explorer, but didn't see anything promising.

这是我要扩展的上下文菜单.

This is the context menu I'm trying to extend.

我正在尝试做的事情是否可行,或者 Git 历史记录页面是否以无法扩展的方式构建?

Is what I'm trying to do possible, or is the Git History page built in a way that it can not be extended?

在此先感谢您的帮助!

推荐答案

对于那些可能想做类似事情的人,这是我添加的内容.

For those who may be looking to do something similar this is what I added.

<GuidSymbol name="PackageCommandSetGuid" value="{57735d06-c920-4415-a2e0-7d6e6fbdfa99}">
  <IDSymbol value="0xf040" name="GitHistory_ContextMenu" />
</GuidSymbol>

这是生成的上下文菜单,我的按钮添加到底部.

Here is the resulting context menu looks like with my button added to the bottom.

这篇关于创建 Visual Studio 扩展以将项目添加到 Git 历史记录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆