code completion help...

christopher j bottaro cjb at cs.utexas.edu
Sat Feb 3 12:05:49 GMT 2001


On Sunday 04 February 2001 03:34, you wrote:
>   But this simplicity doesn't hold at all for completing on object
> instances.  If I declare a local "FooClass x;", then later type "x.", I
> want to see a list of all the non-static members of FooClass. But, at the
> moment, I don't even know the type of "x", and no regular expression will
> figure that out. Consider, for instance, that the "x" variable might
> actually be declared anywhere in the current method, as a static or
> instance field of the enclosing class, or as a global object.

you're right.  as of now my code completion will only recognize class 
variables that are picked up by kdevelop's class parser.  but i don't see why 
i can't overwrite CEditWidget's keyPressEvent() to recognize when an 
identifier is typed and grab the identifier typed before it (the variable's 
type), and put it in a variable store thats local to the scope the cursor is 
in.  that way, when a dot is typed, it will search the local variable store, 
and if its not found, then search the class store of the class parser.  if 
the cursor is moved to a different scope, it will delete the local variable 
store and scan the whole scope that the cursor is in and repopulate the local 
variable store, which shouldn't take long cuz a modern computer can scan a 
1000 line method definition in less than a second.

anyways, i appreciate the info.  i just undertook this project because i'm 
really really used to msvc++'s code completion.  i have a few more month's 
till i go back to school, and this is a fun project for me.  if i get it done 
by then, bad ass!  if not, oh well, i'm sure i will have learned a lot...=)

the global variables do pose a major difficultly according to my current 
plan...=(

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