code completion help...

christopher j bottaro cjb at cs.utexas.edu
Sat Feb 3 03:26:31 GMT 2001


On Saturday 03 February 2001 09:39, you wrote:
> Not sure. I might be able to help if I could see your patch. What version
> of kdevelop are you dealing with? kdevelop1.3, 1.4 or 2.0?

doh, that was stupid of me, i'm working on 1.4...=)  this is my first linux 
project and also first qt/kde project ever, and i have no idea how a patch 
works.  could you point me in the direction of where i could pick up some 
info on em?

> What about using a QPopupMenu instead of a QListBox? Does that have the
> style and functionality you want? But look at dbgtoolbar.cpp for code that
> uses a QFrame without the decorations. (again in kdevelop1.4 not the
> kdevelop2.0. I've yet to fix that properly)

i'm not sure about the functionality of each, but a listbox came to mind 
because of the scoll bars and the ability of the user to resize it.

> Sounds good. I'd be very interesting in seeing what you have, especially if
> you are working on kdevelop1.4.

so far the way it works is, it uses a QStack to push/pop curly braces to find 
the begining and end lines of the method definition and the method signature 
that the cursor is in.  then when you hit a '.' or '->' it grabs the last 
word you typed and method signature and looks up the class that the method 
belongs to, then searches the class store for the class to see if it has the 
"last word" was defined in it.

so far, for the sake of wanting to get something working quickly, i broke 
modularity all over the place i think.  i made CEditWidget a friend of 
KWriteDoc and KWriteView and vice versa.  i made a few select class vars 
public, etc.  i'll change all that and make proper public interfaces once its 
ready for presentation.

there are two things that would help me out a lot.
1)  whats a regular expression definition that would match a c++ method 
signature?  i.e.  match something like "QStringList* 
CCodeCompletion::getMethods(const QString& aClassVar) {"
2)  some algorithm to convert someone's method signature they type in a .cpp 
file to match the string required by 
CParsedContainer::getMethodByNameAndArg().  i think i'll work on this today, 
but once thats done, the code completion class should recognize method params 
as well as class vars.

thanks for the feedback.  this if fun and exciting.  nothing like interest in 
your work to get ya motivated!

christopher


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



More information about the KDevelop mailing list