转到在Visual Studio中关闭标签(使用Resharper)? [英] Go to closing Tag in Visual studio (using Resharper)?
本文介绍了转到在Visual Studio中关闭标签(使用Resharper)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Visual Studio 2010中使用最新的Resharper(v 8.1).
是否存在跳转到结束标签"的键盘快捷键/功能?
Is there a keyboard shortcut/feature to "Jump to closing tag" ?
例如:如果光标在第一个tr
上:
For example : if the cursor is on the first tr
:
我希望光标移至结束位置tr
,即</tr>
I want the cursor to go to the closing tr
which is </tr>
这是否有任何捷径?
(ps-类似 goto matchine brace 但适用于Xml/html标记)
(p.s. - something like goto matchine brace but for Xml/html tags)
推荐答案
好吧,这是我构建的宏的答案(切换),包括转到焦点:
Ok here is the answer as macro which i've built which does it (toggle ) including go to focus :
这是演示:
这是代码,请尽情享受吧!
And here is the code , enjoy !
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.Windows.Forms
Public Module Module2
Sub beginToEnd()
'Place cursor somewhere in beginning tag, run macro, to select from beginning to End Tag
DTE.ActiveDocument.Selection.SelectLine()
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim topPoint As TextPoint = objSel.TopPoint
Dim lTopLine As Long = topPoint.Line
objSel.GotoLine(lTopLine, False)
' DTE.ActiveDocument.Selection.StartOfLine()
DTE.ActiveDocument.Selection.SelectLine()
Dim line1 As String = DTE.ActiveDocument.Selection.Text()
If InStr(line1, "/") Then
' MsgBox(line1)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, True)
objSel.GotoLine(lTopLine, False)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
Else
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ActiveDocument.Selection.EndOfLine(False)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
End If
DTE.ActiveDocument.Selection.SelectLine()
Dim line2 As String = DTE.ActiveDocument.Selection.Text()
Dim objSel3 As TextSelection = DTE.ActiveDocument.Selection
Dim topPoint3 As TextPoint = objSel3.TopPoint
Dim lTopLine3 As Long = topPoint3.Line
objSel.GotoLine(lTopLine3, False)
DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, False)
End Sub
End Module
这篇关于转到在Visual Studio中关闭标签(使用Resharper)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文