DUContext::range()

Hamish Rodda rodda at kde.org
Thu Jul 2 00:43:57 UTC 2009


On Tue, 30 Jun 2009 04:11:04 am Ramon Zarazua wrote:
> On Sunday 28 June 2009 07:16:01 am David Nolden wrote:
> > Am Sonntag 28 Juni 2009 05:10:53 schrieb Ramon Zarazua:
> > > Well I have been having a problem where sometimes a call to
> > > DUContext::range() through DUContext::findContextIncluding() will
> > > return an empty range. from what David told me it is usually for
> > > contexts that are not open on the editor, but I am testing it always
> > > with open documents on the editor. To my knowledge this is a bug, or
> > > maybe there is another way to accessincluding context from an editor
> > > range?
> >
> > Well no it is not normal to be empty. It is normal for the top-context
> > range not to have the exact size of the document though.
> >
> > The only contexts that have empty ranges are usally those that were
> > expanded by a preprocessor macro, since they cannot have a valid range in
> > the document.
> >
> > If you don't want "findContextIncluding(Range)" to return you such empty
> > ranges, then you should call it non-empty ranges, as only empty ranges
> > can be contained by an empty range.
> >
> > Greetings, David
>
> Then this seems to be a Bug, because I have tried it with different
> documents, and sometimes on the TopDUContext the range is 0, and sometimes
> it is not. I have yet to find the common denominator. It is possible that
> it might be due to a local change, but I doubt it, since I have not changed
> any code related to text ranges.

Can you point us at the code where the problem is occurring?  If you can't 
commit to head, make a branch so we can look at it.

Cheers,
Hamish.




More information about the KDevelop-devel mailing list