code completion help...

Roland Krause rokrau at yahoo.com
Wed Feb 14 17:43:36 GMT 2001


Daniel,
thanks for the nice answer. I know understand much better where the
problem really is. 

--- Daniel Berlin <dberlin at redhat.com> wrote:
> > It parses good enough for a graphical classviewer but not 
> > for code completion? 
> It barely does that. Try using it to parse STL headers sometime.

I will try.

> One of the only things fast enough that's open source is ctags,
> strangely enough.

Indeed, but ctags isn't really a class parser either, or is it?
 
> > Could it not be enhanced with an API that doesnt change much and
> > on which the actual code completion could be built. Then the class
> > parser can be replaced later. 
> Sure, you could do this, but it would be pretty pointless.

Still I am not sure about this. Say if you had code completion frontend
code and it was slow then you'd still be much better off than without
it. 

> It's not the API necessarily, you can cache the information you
> need. It's the parsing time and lack of ability to parse some even
> non-complex constructs. Realize that code completion requires being
> able to determine the scope of the variable you are trying to
> complete, then it's type, then lookup the type, and get all the
> relevant info, and present it to the user, in less than a second. 

I see, I was thinking about the wrong end of the problem. The
bottlenecl isnt really parsing the existing class structure of the
project since that is already done when the project is opened. The
bottleneck is parsing the currently edited source... 

> If
> you are looking up  function arguments, it's a bit easier, since you
> must have the variable and type already.
> 
> You also need to have error recovery that works (which we really
> don't).
> You have to realize that proper parsing is a very hard task. Both
> Borland, and MS, use the same parser as they have in their compiler,
> to do it. 
> (Borland just happens to have a very fast parser, so they don't do
> incremental parsing).

Hmm, hence the idea to use gcc's preprocessor, I see.

> --Dan
Well, thanks for being patient w/my questions
Roland



=====
Roland Krause



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
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