Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] TextHover patch - version 2

A new verion of  patch to provide TextHover capability to CDT is available at

http://people.redhat.com/cmoller/TextHoverPatch/

in org.eclipse.cdt.ui.libhover-fragment.zip



What it Does:

If a user leaves the pointer on a text string for a couple of seconds, TextHover tries to look up that string in a database of known C/C++ library functions.  If the string is found, information pertaining to that function is displayed in a popup until the pointer is moved.  This initial release contains databases for the standard C library, glibc, as well as for the GTK+ libraries: GTK, GDK, and GDK-pixbuf; other databases can be easily added.

[New version: the GTK+, et. al., libes aren't included right now.  They'll be along as soon as I re-write the gtk-doc parser in Java.]


How it Works:

When the fragment is first invoked, one or more provided library description XML files is parsed and a search is made for the supplied target string.    If the string is found, relevant data is retrived and formatted for display;   the XML files can contain encoded representation of library API information such as function, struct, enum, typedef, etc., descriptions.  The parsed versions of the XML files are retained, accelerating subsequent accesses of the fragment.


Patch Details:

The patch is a sef-contained fragment that resides in org.eclipse.cdt.ui.libhover and plugs into org.eclipse.cdt.ui.CCompletionContributor.  It contains a file glibc.xml, by default in org.eclipse.cdt.ui.libhover/libhoverdocs but which can be located anywhere, even outside of the Eclipse structure, with no more than slight modifications to the project fragment.xml file.  Future descriptor XML files can also be put in the same directory, or in other directories along a defined search path.

TODOs:
  • Add the code to handle multiple descriptor XML files.
  • Add additional descriptor XML files.
  • Add a means of allowing the user to (re)define the default search path.
  • Add a means of allowing the user to select from the available descriptor files.
  • Add a means of allowing the user to access whatever documentation parsers are available.  (The only parser available at the present is the one that abstracts Texinfo files into the appropriate XML structure.  It's not included in this package (yet.))
Known problems:
  • The first access of the extension is slow due to the time it takes to parse the XML file(s).

Chris Moller
Senior Hacker
Red Hat, Inc.

Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top