Code completion in KDEStudio

Matthias Hoelzer-Kluepfel mhk at caldera.de
Thu Apr 12 09:07:55 UTC 2001


Am Donnerstag 12 April 2001 01:41 schrieb Roland Krause:

> Maybe someone should try to state the problem cleanly first. I am sure
> it is possible to solve it rapidly then.

Hi, as I am new to this list, I hope I don't repeat too much of old 
discussion when I give my 2 cents.

There are at least two parts of the problem that have to be solved:

1) We have to find out what the type of the entity to complete is

   E.g. you type "okButton.", so we need to know of okButton is a
   QPushButton or a what ever.

2) We have to find the possible completions for that type, i.e. the
   methods, members etc.

I guess that with a complete parser, you can solve both problems, but I think 
that this effort is not necessary. 2) is much easier, as it can be solved 
with ctags. Just do a "cpp $(INCLUDES) foobar.cpp | ctags --lang=c++" and you 
get a list of all the completions you might ever need. And it is very fast. 

Unfortunately, for 1) I don't think there is an easy solution. You have to 
build the symbol table, which means to parse the (preprocessed) code until 
you arrive at the entity in question. But it might be possible to do this 
with a much simpler (and more efficient) parser then the one used by an 
actual compiler, as you don't have to look into things that won't affect the 
symbol table at all. But it would still be quite some work to write one.


Bye,
Matthias.



-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list