Updated class browser

David Nolden david.nolden.kdevelop at art-master.de
Thu Apr 2 06:48:29 UTC 2009


Am Donnerstag 02 April 2009 03:37:54 schrieb Hamish Rodda:
> On Thursday 02 April 2009 10:18:03 Lior Mualem wrote:
> > I'm probably using the DUChains wrong but I have no idea why. Do I need
> > to delete myself the declarations that I retrieve from the DUChains? I
> > don't recall seeing any mentioning for this in the documentation (except
> > the usage of a DUChainPointer which I use).
>
> Don't know, perhaps David has an idea.
To me, this looks like you have deleted an object that belongs to the duchain, 
specifically a KDevelop::ParsingEnvironmentFile, which is something you should 
never do. You should never delete any duchain objects.

> > 2. I'm not sure how to monitor class changes efficiently (to reflect
> > changes in list of functions / variables) - I'm using DUChainObserver
> > retrieved from DUChain::self()->notifier(), I then connect to the
> > branchModified signal. The problem with that is that I get 2
> > notifications for each change: 1. The context range for the first call is
> > the entire document (by querying the range() function).
> >   2. The context range for te second call is zero start and end lines.
> > It doesn't matter what I change in the document, class level, function
> > level, document level - the results are the same.
> >
> > Now - I could use this notification and then do the extra work and update
> > all the classes that relate to the document but Isn't it suppose to
> > notify my on a child context changes (for example the class declaration
> > level context)? or am I missing something here?
>
> We once had it that every duchain change was notified, but that was a huge
> performance hit.  Now we just have the branch, and for the moment it just
> reports a change to the whole chain rather than the specifics that changed.
>
> So yes, you have to update all classes that relate to the document.  The
> old code had this, if you want to study it to find out how.

Yes, you should just wait for a document update, and then just consider 
everything within that document as changed.

Greetings, david





More information about the KDevelop-devel mailing list