作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以前的Visual Studio(VS)版本已经回答了这个问题。所提供的解决方案涉及宏,而VS 2015中不再提供这些宏。我能否获得VS 2015的解决方案?
我想在VS中进行“查找全部”操作,并在查找匹配的每一行上放置一个调试断点。
链接到诺亚提出的先前问题:
How do I add Debug Breakpoints to lines displayed in a "Find Results" window in Visual Studio
最佳答案
我已将旧宏转换为Visual Commander中的VB命令(通过向类添加显式命名空间):
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
关于visual-studio - 如何在Visual Studio 2015的 “Find Results”窗口中显示的行上添加调试断点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38061627/
我是一名优秀的程序员,十分优秀!