如何更改 Visual Studio 2017 中的查找结果格式? [英] How to change the Find result format in Visual Studio 2017?

查看:47
本文介绍了如何更改 Visual Studio 2017 中的查找结果格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在早期版本的 Visual Studio 中,您可以通过更改 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{VSVersion}\Find\Find result format 的值来更改显示结果的方式.特别是,我会将它设置为 $f$e($l): $t\\r\\n ,这会从条目中删除完整路径.

In earlier versions of Visual Studio, you could change the way that results from Find are presented by altering the value of HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{VSVersion}\Find\Find result format. In particular, I would set it to $f$e($l): $t\\r\\n which removes the full path from the entry.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0\Find\Find result format 进行相同的更改似乎没有任何作用.在 VS2017 中还有其他方法可以解决这个问题吗?

Making the same change to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\15.0\Find\Find result format doesn't seem to do anything. Is there another way to address this in VS2017?

推荐答案

VS 2017 现在使用私有注册表(参见 Visual Studio 2017 RC 在哪里存储其配置?).直接访问它的一种方法是使用我的 Visual Commander 扩展从正在运行的 Visual Studio 2017 实例.例如,您可以使用以下 C# 命令:

VS 2017 now uses private registry (see Where does Visual Studio 2017 RC store its config?). One way to access it directly is from a running Visual Studio 2017 instance with my Visual Commander extension. For example, you can use the following C# command:

public class C : VisualCommanderExt.ICommand
{
    public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
    {
        var key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(
            @"Software\Microsoft\VisualStudio\" + DTE.Version + @"\Find");
        key.SetValue("Find result format", @"$f$e($l): $t\r\n");
    }
}

这篇关于如何更改 Visual Studio 2017 中的查找结果格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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