Tho*_*n79 20 eclipse integration eclipse-plugin stackexchange-api
好吧,这只是一个疯狂的想法.Stack Overflow看起来非常结构化,可以集成到开发应用程序中.那么,有可能,甚至是有用的,有一个Stack Overflow插件,比如Eclipse吗?
您希望将Stack Overflow的哪些功能直接集成到IDE中,以便您可以"本机"使用它而无需更改为浏览器?
编辑:我正在考虑更深层次的集成方法,而不仅仅是使用IDE中的网页.就像你使用某个Java类并遇到问题一样,来自SO的答案可能会爆发.可能会出现类似这样的事情令人讨厌的情况,但其他人可能会非常有帮助.
Chr*_*lor 21
跟进Josh的回答.此VS宏将在Visual Studio IDE中搜索StackOverflow以查找突出显示的文本.只需突出显示并按Alt + F1即可
Public Sub SearchStackOverflowForSelectedText()
    Dim s As String = ActiveWindowSelection().Trim()
    If s.Length > 0 Then
        DTE.ItemOperations.Navigate("http://www.stackoverflow.com/search?q=" & _
            Web.HttpUtility.UrlEncode(s))
    End If
End Sub
Private Function ActiveWindowSelection() As String
    If DTE.ActiveWindow.ObjectKind = EnvDTE.Constants.vsWindowKindOutput Then
        Return OutputWindowSelection()
    End If
    If DTE.ActiveWindow.ObjectKind = "{57312C73-6202-49E9-B1E1-40EA1A6DC1F6}" Then
        Return HTMLEditorSelection()
    End If
    Return SelectionText(DTE.ActiveWindow.Selection)
End Function
Private Function HTMLEditorSelection() As String
    Dim hw As HTMLWindow = ActiveDocument.ActiveWindow.Object
    Dim tw As TextWindow = hw.CurrentTabObject
    Return SelectionText(tw.Selection)
End Function
Private Function OutputWindowSelection() As String
    Dim w As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
    Dim ow As OutputWindow = w.Object
    Dim owp As OutputWindowPane = ow.OutputWindowPanes.Item(ow.ActivePane.Name)
    Return SelectionText(owp.TextDocument.Selection)
End Function
Private Function SelectionText(ByVal sel As EnvDTE.TextSelection) As String
    If sel Is Nothing Then
        Return ""
    End If
    If sel.Text.Length = 0 Then
        SelectWord(sel)
    End If
    If sel.Text.Length <= 2 Then
        Return ""
    End If
    Return sel.Text
End Function
Private Sub SelectWord(ByVal sel As EnvDTE.TextSelection)
    Dim leftPos As Integer
    Dim line As Integer
    Dim pt As EnvDTE.EditPoint = sel.ActivePoint.CreateEditPoint()
    sel.WordLeft(True, 1)
    line = sel.TextRanges.Item(1).StartPoint.Line
    leftPos = sel.TextRanges.Item(1).StartPoint.LineCharOffset
    pt.MoveToLineAndOffset(line, leftPos)
    sel.MoveToPoint(pt)
    sel.WordRight(True, 1)
End Sub
安装:
这一切都取自杰夫阿特伍德的谷歌搜索VS宏帖子,只是修改为搜索StackOverflow而不是.
在Visual Studio中,您可以添加快捷方式以在StackOverflow中搜索突出显示的术语.杰夫阿特伍德写了他在Google搜索VS.NET宏博客条目中与Google做类似的事情.
使用此方法可以突出显示术语或错误消息(或IDE中的任何其他可选文本),按快捷键,然后在StackOverflow上查看所有匹配的结果.
我确信在其他IDE中也有办法做到这一点.
| 归档时间: | 
 | 
| 查看次数: | 1042 次 | 
| 最近记录: |