最兼容的 C++ Doxygen 对 IDE 的评论

发布于 2024-12-28 18:54:30 字数 624 浏览 0 评论 0原文

我一直在研究一些与我一起工作的其他开发人员将使用的一些 C++ 代码。这里的很多开发人员都是基于 MS 的(他们使用 Visual Studio 作为主要 IDE),我们也有很多开发人员使用其他 IDE 来完成不同的项目(例如 Eclipse 和 Qt,甚至使用 XCode 进行一些 C++ Mac 开发)。

我拥有的代码是跨平台兼容的通用库函数,因此它将由不同平台/IDE 上的不同开发人员使用。这让我想到了我的问题:是否有一种兼容的 Doxygen 注释“风格”可以被大多数流行的 IDE(VS、Eclipse、Qt、Netbeans、XCode)“理解”并与代码完成功能一起使用? 类似于 VS 的 IntelliSence,当您使用范围结果时,会弹出该项目的描述。

如果没有“兼容”的方式,是否有可用于所有 IDE 的插件来实现此功能,还是我必须编写自己的插件?谷歌搜索让我陷入了许多死胡同(可能是因为我可能没有将我的问题输入正确的搜索词),并且编写我自己的插件是一种选择,尽管我更喜欢“兼容”样式或现有插件(如果可能的话)时间。

提前致谢!

编辑 1:我应该提到,我请求 Doxygen 风格的注释,因为它是我们用来构建一些文档的文档工具,因此我们所做的任何代码中的所有注释都必须是 Doxygen 风格(不知道为什么这个问题以前从未出现过)在这里,哈哈)

I've been working on some C++ code that some of the other developers I work with will use. A lot of the developers here are MS based (they use Visual Studio as their main IDE) we also have a lot of developers who use other IDE's as well for different projects (like Eclipse and Qt, even some C++ Mac development with XCode).

The code I have are generic library functions that are cross platform compatible, so it will be used by different developers on different platforms/IDE's. Which brings me to my question: is there a compatible Doxygen comment 'style' that can be 'understood' and used with the code completion ability by most popular IDE's (VS, Eclipse, Qt, Netbeans, XCode)?
Something like VS's IntelliSence where when you use your scope resultion a description pops up for that item.

If there is not a 'compatible' way, are there any plugins that can be used for all IDE's that would allow for this ability, or would I have to write my own? Googling has lead me to many dead ends (possibly because I may not be inputing my question into correct search terms), and writing my own plugins is an option, though I'd prefer a 'compatible' style or existing plugin if possible to save time.

Thanks in advance!

Edit 1: I should mention that I am requesting Doxygen style commenting becuase it is the documenting tool we use to build out some of our documentation thus all comments in any code we make must be Doxygen style (not sure why this issue never came up before here, haha)

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

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

发布评论

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

评论(1

时光暖心i 2025-01-04 18:54:30

所以我现在一直在为这个问题苦苦挣扎一段时间。过去,我使用过几种不同的软件套件进行开发,每个套件在使用文档驱动一些更奇特的功能方面都有自己的怪癖。在使用 C#(和 Visual Studio 2010)完成一个项目后,我开始意识到 XML 注释似乎最适合我。

我个人认为,这是大多数 IDE 应用程序本身的失败,例如,Visual Studio 似乎实际上只支持 C# 应用程序的 XML 注释来提供诸如 Intellisense 之类的功能,以及不太花哨的语法突出显示。我发现有一个商业插件可用于在 Visual Studio 中“启用”此功能,但为什么我要为尚未启用的功能付费呢?

但我偏离了你原来的问题。当我第一次研究这个时,苹果自己似乎必须使用 Doxygen,因为他们似乎使用这个

  • Atomineer Pro 文档 似乎是 Visual Studio 方面的工作工具,尽管我个人没有使用过它。使用起来似乎比较简单。
  • Eclox 似乎是 Eclipse 的一个前端插件,实际上使用多氧。但据我记得,您应该能够在 C++ 设置中调整 IDE 本身的语法突出显示。
  • Doxymacs 在 Emacs 内部维护一个符号表,以实现一些快速搜索功能。
  • 似乎在 Vim 项目页面上有一个脚本也可以为该编辑器处理这个问题,它被称为 DoxygenToolkit

我绝对感受到你的痛苦。让每晚的 crontab 生成清晰记录且易于搜索的标记会让人感到温暖和愉快。我最近才开始寻找实现这种跨平台的最佳机制。根据我收集的信息,大多数开发环境都支持各种扩展,并且由于 Doxygen 基本上是“黄金标准”,因此如果不存在开箱即用的支持,通常会通过一种或另一种方式来提供支持。

如果您感兴趣,Doxygen 实际上支持开箱即用的 C# XML 注释,但不幸的是我无法让它在 Xcode 中工作,而且我不太熟悉 AppleScript,无法将其组合在一起。但无论如何请更新,如果你这样做!

So I have been struggling with this question for awhile now. In the past I have used several different software suites for development, with each having its own quirks in regards to using the documentation to drive some of the more fancy features. After working on a project in C# (and Visual Studio 2010) I have come to realize that the XML commenting seems to work the best for me.

I personally believe that this is a failure in most of the IDE applications themselves, for example, it seems that Visual Studio really only supports XML commenting for C# applications to feed features such as Intellisense, and the less fancy syntax highlighting. I have found that there is a commercial plugin available to "enable" this feature in Visual Studio, but why should I pay for something that just has not been enabled?

But I have diverged from your original question. When I was first researching this it seemed that Apple themselves must use Doxygen as they seem to use this standard for highlighting code already. With that said, here are some other resources to get the same functionality in other applications:

  • Atomineer Pro Documentation seems to be the tool for the job in regards to Visual Studio although I have not personally used it. It seems relatively simple to use.
  • Eclox seems to be a front-end plugin for Eclipse that actually uses Doxygen. But from what I remember you should be able to tweak the IDE itself in the C++ settings in regards to syntax highlighting.
  • Doxymacs maintains a symbol table inside of Emacs for some quick searching abilities.
  • It seems that on the Vim project page there's a script that handles this for that editor as well, it is called DoxygenToolkit.

I absolutely feel your pain. There's something warm and toasty about having a nightly crontab generate cleanly documented markup that is easily searchable. I have only recently been on a warpath for finding the best mechanism available for achieving this cross-platform. From what I've gathered most development environments support extensions of sorts, and since Doxygen is basically the "gold standard" there's usually one way or another to shoehorn support in if it doesn't exist out of the box.

If you're interested Doxygen actually supports the C# XML comments out of the box, but unfortunately I wasn't able to get it working in Xcode, and I'm not well versed enough in AppleScript to hack it together. But by all means please update if you do!

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