将 Doxygen 与 Visual Studio 2010 结合使用

发布于 2024-09-26 07:51:11 字数 180 浏览 0 评论 0原文

我在将 Doxygen 与 Visual Studio 2010 和 C++ 一起有效使用时遇到困难。

除了“取消/注释行”之外没有其他注释功能吗?例如,生成注释存根,并在新行后添加 ///

另外,我想知道需要什么才能在 VS2010 的 IntelliSense 功能中显示这些注释?

I have difficulties efficiently using Doxygen with Visual Studio 2010 and C++.

Is there no other function for commenting than "un/comment lines"? For example generating comment stubs, and adding /// after a new line.

Also, I wonder what is needed to display those Comments within the IntelliSense feature in VS2010?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

数理化全能战士 2024-10-03 07:51:11

根据 MSDN 文档,任何使用 // 的注释/* 分隔符将显示在 IntelliSense 成员列表中关联成员的旁边。

您可以使用 doxygen 的 XML 输出或 Visual Studio 生成的 XML 文档作为智能感知输入。

/doc 文档说明了如何将 XML 文档与 IntelliSense 结合使用:

要将生成的 .xml 文件与 IntelliSense 一起使用,请使 .xml 文件的文件名与要支持的程序集相同,并将 .xml 文件放在与程序集相同的目录中。当在 Visual Studio 项目中引用该程序集时,也会找到 .xml 文件。

AtomineerUtils 是 doxygen/javadoc/DocXML 文档的最佳 Visual Studio 插件之一。它不是免费的,但 doxygen 帮助工具列表中没有任何内容是针对 Visual Studio 2010 的。

According to the MSDN Documentation, any comments using // or /* delimiters will be displayed next to the associated member in the IntelliSense Members list.

You can use doxygen's XML output or the XML documentation generated by Visual Studio as IntelliSense input.

The /doc documentation explains how to use XML documentation with IntelliSense:

To use the generated .xml file with IntelliSense, make the file name of the .xml file the same as the assembly that you want to support and put the .xml file is in the same directory as the assembly. When the assembly is referenced in the Visual Studio project, the .xml file is also found.

AtomineerUtils is one of the best Visual Studio add-ins for doxygen/javadoc/DocXML documentation. It's not free, but nothing on the list of doxygen helper tools is targeted at Visual Studio 2010.

病毒体 2024-10-03 07:51:11

我自己能想到的最好的办法就是宏的集合。我四处寻找可能将一些有用的 Visual Studio doxygen 宏聚合在一起的网站,但到目前为止还是空的。但是,使用 Visual Studio 的代码模型自动填充文档确实非常方便。这是我为插入符号当前所在的函数创建文档而制作的宏:

Sub FunctionDoc()
    DTE.UndoContext.Open("Function Doc")
    Try
        Dim caretPosition As TextPoint = DTE.ActiveDocument.Selection.ActivePoint
        Dim element As CodeElement = _
            caretPosition.CodeElement(vsCMElement.vsCMElementFunction)
        If element.Kind <> vsCMElement.vsCMElementFunction Then
            MsgBox("That is not a function")
            Exit Sub
        End If
        Dim func As CodeFunction = element
        If func Is Nothing Then
            MsgBox("That is not a function")
            Exit Sub
        End If

        Dim ts As TextSelection = DTE.ActiveDocument.Selection
        ts.StartOfLine()
        ts.NewLine()
        ts.LineUp()
        Dim functionName As String = func.Name
        ts.Text = "//-----------------------------------------------------------------------------"
        ts.NewLine()
        ts.Text = "//  FUNCTION  "
        ts.Text = func.FullName
        ts.NewLine()
        ts.Text = "/// \brief    "
        Dim endline As Integer = ts.BottomPoint.Line
        Dim endoffset As Integer = ts.BottomPoint.LineCharOffset
        ts.NewLine()
        ts.Text = "///           "
        ts.NewLine()
        For Each param As CodeParameter In func.Parameters
            ts.Text = "/// \param    "
            ts.Text = param.Name
            ts.Text = ". "
            ts.NewLine()
        Next
        If func.Type.TypeKind <> vsCMTypeRef.vsCMTypeRefVoid Then
            ts.Text = "/// \return   "
            ts.Text = func.Type.AsFullName
            ts.Text = " "
            ts.NewLine()
        End If
        ts.Text = "//-----------------------------------------------------------------------------"
        ts.MoveToLineAndOffset(endline, endoffset)

    Finally
        DTE.UndoContext.Close()
    End Try
End Sub

请随意编辑或重用此宏,我欢迎任何批评。

The best that I have been able to come up with on my own has been a collection of macros. I have looked around for websites that may have aggregated some useful Visual Studio doxygen macros together, but so far have come up empty. But, using Visual Studio's code model to auto-populate the documentation can be really handy. Here is a macro that I made to create documentation for the function that the caret is currently in:

Sub FunctionDoc()
    DTE.UndoContext.Open("Function Doc")
    Try
        Dim caretPosition As TextPoint = DTE.ActiveDocument.Selection.ActivePoint
        Dim element As CodeElement = _
            caretPosition.CodeElement(vsCMElement.vsCMElementFunction)
        If element.Kind <> vsCMElement.vsCMElementFunction Then
            MsgBox("That is not a function")
            Exit Sub
        End If
        Dim func As CodeFunction = element
        If func Is Nothing Then
            MsgBox("That is not a function")
            Exit Sub
        End If

        Dim ts As TextSelection = DTE.ActiveDocument.Selection
        ts.StartOfLine()
        ts.NewLine()
        ts.LineUp()
        Dim functionName As String = func.Name
        ts.Text = "//-----------------------------------------------------------------------------"
        ts.NewLine()
        ts.Text = "//  FUNCTION  "
        ts.Text = func.FullName
        ts.NewLine()
        ts.Text = "/// \brief    "
        Dim endline As Integer = ts.BottomPoint.Line
        Dim endoffset As Integer = ts.BottomPoint.LineCharOffset
        ts.NewLine()
        ts.Text = "///           "
        ts.NewLine()
        For Each param As CodeParameter In func.Parameters
            ts.Text = "/// \param    "
            ts.Text = param.Name
            ts.Text = ". "
            ts.NewLine()
        Next
        If func.Type.TypeKind <> vsCMTypeRef.vsCMTypeRefVoid Then
            ts.Text = "/// \return   "
            ts.Text = func.Type.AsFullName
            ts.Text = " "
            ts.NewLine()
        End If
        ts.Text = "//-----------------------------------------------------------------------------"
        ts.MoveToLineAndOffset(endline, endoffset)

    Finally
        DTE.UndoContext.Close()
    End Try
End Sub

Feel free to edit or reuse this macro, and I welcome any critiques.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文