Display Library Function Help Text in Eclipse C/C++ Projects

In this short article I show you how to enable one of the hidden gems in Eclipse: how to get a description of the library function used in the code

Library Hover

snprintf() help text

Eclipse is great helping me writing code. One of the shortcuts I use most is <CTRL>+Space for ‘Code Completion’ which gives me suggestions what to write or complete:

Code Completion in Eclipse

Code Completion in Eclipse

It would be great if it could give me some more information about that function? Actually this is possible:

Code Completion with Library Information

Code Completion with Library Information

All what it needs is to install the Libhover plugins from the Eclipse Linux Tools project. The Eclipse Linux project is mostly used for Linux (hence the name), but some plugins are usable for any other embedded development.

To install it, use the menu Help > Install New Software and point to the following update site:

http://download.eclipse.org/linuxtools/update

and install the following three plugins

  • C/C++ Library API Documentation Hover Help
  • Libhover for Newlib Feature
  • Library Hover help for devhelp documentation
Libhover Plugins

Libhover Plugins

After a restart of the IDE, I can use the feature, such as moving the mouse cursor over a library call:

Library Hover

Library Hover

Pressing F2 or clicking into the hover let me scroll down to see the full description including examples.

💡 The plugin includes documentation for the newlib library, and the plugin documentation explains how more information or libraries could be added.

Happy Hovering 🙂

Links

Advertisements

5 thoughts on “Display Library Function Help Text in Eclipse C/C++ Projects

  1. I’d forgotten all about this! I found it before, but I think it wasn’t compatible with CodeWarrior’s version of Eclipse or something and I gave up on it. One of my favorite things about the Borland Turbo C++ IDE (where I got my start in C/C++ 26+ years ago) was its context-sensitive help system. All of the standard libraries and Borland’s libraries were documented there, and each function had *examples*. Also indexes for each header file, I think. I’ve never forgotten the example for the sound() function.

    https://everything2.com/title/7+hertz+-+the+resonant+frequency+of+a+chicken%2527s+skull

    Like

  2. Hello.

    There is some option to modify the font of Code completion, mine is very small. I have access to General> Appearance> Colors and fonts, but I did not find any to modify the Code completion font.

    And a request, could you make an article about the DMA? It is something that I do not know much about, and I think it is very important, I am now reading the RT1020 Reference Manual and seeing the SDK examples, I still see it as complex due to the amount of parameters that exist. Nor do I find any tutorial or any book that deals in depth with the DMA.

    Specifically, I need the DMA for a program that receives data through SPI in slave mode, and also to transfer data in parallel through several GPIO ports to one or more arrays, automatically increasing the destination address in the array with each data entry. The handling by SPI, more or less I see it clear, but the reading of several data in parallel by GPIO ports still seems complicated to me.

    Best Regards

    Like

    • Not sure if there is a way to change the font size of that code completion, I have not found anything.
      About DMA: I have not touched the DMA of i.MX RT, but I assume it is similar to the one used for Kinetis, so you could have a read at my tutorials for that DMA peripheral. The principle should be the same.
      I did use there GPIO DMA to drive WS2812B LED arrays.
      I hope this helps,
      Erich

      Liked by 1 person

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.