Can Eclipse hover tips display Doxygen comments from header file?

萝らか妹 提交于 2019-11-30 04:32:23

Doxygen comments are displayed in Eclipse on hover when written in:

  • cpp file (or header) file before method source (not declaration)
  • header file before class declaration

I found a workaround for this problem, however it's pretty inconvenient for general use.

If you're using an external build system (make/cmake eg.) where eclipse is unable to pass on it's macro definitions, then all you need to do is place the implementation in it's own include guard and add the include guards macro to eclipse's symbol definitions. This will hide that section of code from eclipse, forcing it to use the intended comments without affecting the build.

For example:

#ifndef INCLUDE_GUARD_FOR_IMPLEMENTATION
#define INCLUDE_GUARD_FOR_IMPLEMENTATION

// Implementation code

#endif

and then in project -> properties -> C/C++ General -> Paths And Symbols add INCLUDE_GUARD_FOR_IMPLEMENTATION under the symbols section.

It does of course have the side effect of greying out the section, and if you can't or don't want to put the implementation code in a separate header it might look rather out of place.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!