Code completion

Carsten Pfeiffer carpdjih at cetus.zrz.TU-Berlin.DE
Thu Jan 13 09:15:28 GMT 2000


Hiya,
 
> > i have a little wish. what about add code completion (like c++
> > builder, delphi & m$ visual toolz...) in kdevelop 2?  :) it would be
> > very helpful and do the work on the class jungle more comfortable.
>
> Yes, would be a really nice feature. Unfortunately there is no volunteer
> who will implement this. :-(
 
I'm not subscribed to this list -- I just found this thread accidentally
on lists.kde.org (so please CC any replies to me).
I wrote a class KCompletion, which is in kdecore now. It is a generic
class, that takes any number of completable strings and stores them
internally. Now when a user wants to complete some string, he presses some
key-combination. kdevelop/kwrite should just catch that key-event and call
KCompletion::makeCompletion( the_to_be_completed_string ) -> KCompletion
will return you the first matching string.
 
There are two different modes, auto-completion and shell-completion. The
former returns a complete matching string, the latter returns the largest
possible completion (when there are multiple matches), just like the shell
does. It's pretty easy, yet flexible, just have a look at kcompletion.h --
kdoc-documentation is included.
 
So for the beginning, kwrite could just insert all words of a document
into a KCompletion-object and call makeCompletion() on demand.
 
Richard Moore <rich at kde.org> wrote on kde-core-devel a few days ago, that
he has some classes for managing name-spaces. Combining those with
KCompletion may give you different completions for different classes.

Cheers,
Carsten Pfeiffer
--
http://www.geocities.com/SiliconValley/1632/




More information about the KDevelop mailing list