How to use the documentation of C++ code inside an IDE on linux?

1.3k views Asked by At

Up to now i tried Eclipse, KDevelop and Code::Blocks.

Code::Blocks (12.11) seems not to be able to display documentation at all.

Eclipse (4.3.2) is able to display the documentation of at least the standard libraries during code completion and on hover, but it looks like there is no way to generate or add custom documentation. By now I was able to use DoxygenCPPInfo to convert the xml documentation to a "Java Serialization Data" file, which is useable by libhover. But the documentation is only visible on hover, but not on code completion.

KDevelop (4.7) does only show the comment, which normally contains the documentation, on hover and a heavily shortened version on code completion.

Is there another IDE or something else I could do to benefit from in code documentation while writing new code?


DoxygenCPPInfo can be compiled using the following files from eclipse-linuxtools:

  • ClassInfo.java
  • FunctionInfo.java
  • LibHoverInfo.java
  • MemberInfo.java
  • TypedefInfo.java
  • DoxygenCPPInfo.java

The xml documentation needs to be in one file to be used with DoxygenCPPInfo. This can be done by using xsltproc with combine.xslt and index.xml as input files. The final output of DoxygenCPPInfo can be placed in workspace/.metadata/.plugins/org.eclipse.linuxtools.cdt.libhover/CPP/ and will be loaded on next start of eclipse using that workspace. The documentation is only shown on hover and not on code completion.

1

There are 1 answers

0
Clyt On

You want to document a function in one file and use that function in another file. While using that function you want to reference the documentation written earlier in a tooltip without having to compile the first file. This can be done easily in kdevelop ide. There are not much IDEs I have come across that provide such ease of cross-referencing. Eclipse lib-hover plugin for C but it is clunky and I have had trouble working with that earlier. Here is the link to kdevelop-handbook .

Documenting in doxygen style in kdevelop