3

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.

schwer
  • 279
  • 1
  • 2
  • 10
  • 1
    Your question is not clear. What exactly do you want the IDE to do with your code documentation? If you simply want it to show when you hover your mouse over the usage of that thing (function, etc), then most IDEs will do that. Personally I use Visual Assist X with Visual Studio and it has an option to "show bits of surrounding code", which almost always includes the documentation block above it (I use Doxygen syntax). – void.pointer Nov 29 '14 at 17:10
  • 1
    I'm currently using linux, Visual Studio is not an option for me. I'd like to see the documentation properly formatted beside the code completion popup. – schwer Nov 29 '14 at 17:21
  • What do you mean by "documentation"? Are you referring to some formatted comment block above functions/classes/etc? Please provide an example and more detail. – void.pointer Nov 29 '14 at 18:06
  • I'm using doxygen syntax. Doxygen is able to generate a html documentation, so there should be nothing wrong with the comments. There is nothing that would prevent me from using a different syntax if necessary. – schwer Nov 29 '14 at 18:16
  • Did you try `emacs`? – Basile Starynkevitch Dec 01 '14 at 19:54
  • @BasileStarynkevitch Had a short look into it now. Do you know how to set it up as IDE? – schwer Dec 03 '14 at 17:12
  • I don't understand what is your definition of IDE. For me, `emacs` is an IDE. You may want to customize it (in your `~/.emacs`), perhaps with lines such as `(global-set-key [f8] 'recompile)` but YMMV. – Basile Starynkevitch Dec 03 '14 at 17:15

1 Answers1

2

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

Clyt
  • 616
  • 1
  • 7
  • 13