Visual Studio 2008宏问题

发布于 2024-07-14 22:10:31 字数 233 浏览 7 评论 0原文

我一直在尝试在 Visual Studio 中编写一个简短的宏,激活 FindSymbolResults (Constants.vsWindowKindFindSymbolResults),然后移至列表中的下一项(如果有的话)并对其调用 Edit.GotoReference。 第一部分和最后一部分 - 显示窗口并调用 Edit.GoToReference - 已完成,但我正在努力移至窗口中的下一项。 有没有人有这样做的例子或类似的事情可以分享?

I have been trying to write a short macro in Visual Studio that activates the FindSymbolResults (Constants.vsWindowKindFindSymbolResults), and then moves to the next item in the list (if anyway) and calls Edit.GotoReference on it. The first and last parts - show the window and call Edit.GoToReference - are done, but I am struggling with moving to the next item in the window. Has anyone got an example of doing this or something similar they could share?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵山崖 2024-07-21 22:10:31

我知道在 VS 中 F8 通常会导航到下一个结果。 考虑到这一点,我录制了一个临时宏来查看它可能会产生什么。 有了这些结果,我编写了这个快速的小宏,它将执行并打开查找符号搜索的前 10 个结果。

Sub OpenAllFindSymbols()
    DTE.ExecuteCommand("Edit.FindSymbol")
    DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
    For i = 1 To 10
        DTE.ExecuteCommand("Edit.GoToNextLocation")
    Next
End Sub

,我认为您可能最感兴趣的是

    DTE.ExecuteCommand("Edit.GoToNextLocation")

I know that in VS F8 usually navigates to the next result. With that in mind, I recorded a temporary macro to look and see what it might produce. With those results in hand, I wrote this quick little macro that will execute and open the first 10 results of a find symbol search.

Sub OpenAllFindSymbols()
    DTE.ExecuteCommand("Edit.FindSymbol")
    DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
    For i = 1 To 10
        DTE.ExecuteCommand("Edit.GoToNextLocation")
    Next
End Sub

,All that to say I think the bit that you may be most interested in is

    DTE.ExecuteCommand("Edit.GoToNextLocation")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文