Code completion in KDEStudio
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Apr 11 13:14:09 UTC 2001
I understand how KDEStudio code completion works now. If you type the following:
popup->
...and then right click and select the code completion option. The code edits
your current source file, and changes the line above to
popup->WAIT_STUDIO_WAIT
...which never compiles, but the code extracts the classname from the compiler
error message. It compiles the source with the '-save-temps' option, which
produces a file with a '.ii' suffix containing the C++ source after being
pre-processed. The '.ii' file is parsed as a 'one-off', and the class tree for
the classname extracted from the compiler error message is shown.
I found a problem when you right click to invoke the code completion option,
the I-bar is moved to the current mouse position, which is not what is wanted.
So I changed this method, and found it more reliable with no 'placeCursor()'
call:
void KWriteView::mousePressEvent(QMouseEvent *e)
...
if (kWrite->manager->popup && ee->button() == RightButton) {
// placeCursor(ee->x(),ee->y(),0);
kWrite->manager->popup->popup(mapToGlobal(ee->pos()));
}
...
-- Richard
-
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