Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT API hover help and completion

For anyone who's interested in CDT hover, et. al., here's the latest from Red Hat:

Got a sub-pre-alpha of hover help working.

This version uses ResourceBundles to hold (in my test version) an abstract of the glibc manual *.texi files in a property file:

---------------------------------------------------------------
# extracted from ../../downloads/glibc-2.3.2/manual/stdio.texi

fopen.Name:      fopen
fopen.Headers:   stdio.h
fopen.Type:      FILE *
fopen.Prototype: const char *filename, const char *opentype
fopen.Summary: The fopen function opens a stream for I/O to the file \
filename, and returns a pointer to the stream.
fopen.Synopsis: To be added.
---------------------------------------------------------------

On a hover hit, data is extracted from the property file using the name.property key, stuffed into a newly instantiated class of the right sort and returned for display using a small mod of the existing mechanism. The instanced class is also stored in a HashMap cache so subsequent hover hits of the same fcn can just grab the cached copy rather than building things all over again.

The ResourceBundle approach is cool, mostly because it was easy to implement, but the data included in the file is cast in Jell-o -- if anyone wants other data included, it's easy to do. ResourceBundle is also good because it allows localisation.

On the things-to-do list are:

Fix a couple of bugs.
Fix the getIncludes() method.
Find ways to dynamically add multiple property files for different apps (libc, GTK, X, whatever).
Think about other data formats (e.g. XML).

Any comments, you know where to reach me.

Chris Moller
Tinker-at-Large
Red Hat, Inc



Back to the top