Access current code pane in Visual Studio Extension

前端 未结 1 1462
萌比男神i
萌比男神i 2021-02-13 07:29

Im writing a visual studio (2010) extension with a right click menu whilst in a code view. I want to be able to examine the current code from my menu item event handler but have

1条回答
  •  失恋的感觉
    2021-02-13 08:02

    You may be looking for

    Document doc = DTE.ActiveDocument;
    TextDocument txt = doc.Object() as TextDocument;
    

    You should then be able to edit work with the TextDocument as needed.

    0 讨论(0)
提交回复
热议问题