code completion help...

Daniel Berlin dberlin at redhat.com
Mon Feb 19 08:11:17 GMT 2001


Werner Modenbach <modenbach at alc.de> writes:

> On Samstag, 17. Februar 2001 15:35, Dimitri van Heesch wrote / Am Samstag, 
> 17. Februar 2001 15:35 schrieb Dimitri van Heesch:
> >
> > I don't think M$'s DevStudio uses more info than this for code completion.
> > But then that certainly isn't perfect either.
> >
> > > (Consider a user typing something like
> > > a(function1(), function2(1))->m and waiting for the code completion with
> > > two visible definitions of method "a" with different sets of parameters
> > > and possibly multiple definitions of the functions used as parameters as
> > > well.) Also don't forget type conversion necessary for resolving
> > > ambiguities between multiple definitions, template classes / functions,
> > > inheritance...
> >
> > You could have added partial template specialization to make it even more
> > difficult ;-)
> >
> > For this you'd really need a real compiler and also
> > the time it takes to compile, which is probably not what you want for
> > something that should be done in real time.
I know i'm replying to the wrong person, but this is why it's done
incrementally in most cases.
Or only every so often. MS also preparses the system headers and
distributes the resulting class database.
Search for the ncb files on your HD.
> >
> 
> Hi Dimitri,
> 
> I follow up the discussion about code completion for a while now. I really 
> agree the job is quite complicate to be done in real time.
Depends on how far you go.
It's not that it's difficult, it's just it has to be thought out very
well ahead of time. You can't bolt this stuff on later, or just make
an algorithm faster, like you can with most things. You also can't
just slip something 50x faster into an existing interface. It won't
work. You'll spend so much time trying to shoehorn it in, that you'll
lose.

> 
> But there is another aspect I want to throw into discussion.
> In my opinion everybody talks about the difficult cases here but
> this is not 
> the majority of the cases. For me it would be a great help if code
> completion  

The simplest case is no inheritance, no virtual functions, no access
control, etc.

> would at least cover the simple cases. If it's not a simple case: OK, there 
> might be no completion, but nothing worse than now. So it there is a way to 
> do an 80% code completion for a first throw I would be glad :-))


The problem is, covering the simple cases has to take into account the
hard cases.
What you consider simple, isn't really simple.

I suggest we wait until the gcc C++ parser rewrite is finished.

I already have gcc patches that will output an xml dump of the parse
tree/xref info combined, which is pretty much *exactly* what we need.

But the parser won't be fast enough till it's finished being
rewritten.

In short, i'd just hold on a few months longer, and this whole problem
will get a *lot* easier for us.
I know it's kind of a cop out, but it would take you a lot longer to
even get near a parser complete enough/fast enough.
--Dan


-
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