之前版本的 Visual Studio (VS) 已回答过此问题。提供的解决方案涉及宏,这些宏在 VS 2015 中不再可用。我可以获得 VS 2015 的解决方案吗?
我想在 VS 中进行“查找全部”,并在查找匹配的每一行上放置一个调试断点。
链接到诺亚之前提出的问题:如何将调试断点添加到 Visual Studio 中“查找结果”窗口中显示的行 https://stackoverflow.com/questions/73063/how-do-i-add-debug-breakpoints-to-lines-displayed-in-a-find-results-window-in
我已将旧宏转换为 VB 命令视觉指挥官 https://vlasovstudio.com/visual-commander/(通过向类添加显式名称空间):
Public Class C
Implements VisualCommanderExt.ICommand
Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run
Dim findResultsWindow As EnvDTE.Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindFindResults1)
Dim selection As EnvDTE.TextSelection
selection = findResultsWindow.Selection
selection.SelectAll()
Dim findResultsReader As New System.IO.StringReader(selection.Text)
Dim findResult As String = findResultsReader.ReadLine()
Dim findResultRegex As New System.Text.RegularExpressions.Regex("(?<Path>.*?)\((?<LineNumber>\d+)\):")
While Not findResult Is Nothing
Dim findResultMatch As System.Text.RegularExpressions.Match = findResultRegex.Match(findResult)
If findResultMatch.Success Then
Dim path As String = findResultMatch.Groups.Item("Path").Value
Dim lineNumber As Integer = Integer.Parse(findResultMatch.Groups.Item("LineNumber").Value)
Try
DTE.Debugger.Breakpoints.Add("", path, lineNumber)
Catch ex As System.Exception
' breakpoints can't be added everywhere
End Try
End If
findResult = findResultsReader.ReadLine()
End While
End Sub
End Class
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)