DUContext::range()

Ramon Zarazua rzarazua at digipen.edu
Thu Jul 2 22:37:15 UTC 2009


On Thursday 02 July 2009 02:43:57 am Hamish Rodda wrote:
> 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.

My progress is currently on branches/kdevelop/class-generation-extraction/
the issue happens mainly when I test with makeimplementationpŕivate.cpp The 
exact issue happens on KDevelop::ClassGenerator::executeJob(), when it 
attempts to find the context for the current selection.

As a sidenote, I have been thinking of reworking simplerefactoring.h/.cpp to 
possibly allow in the future for refactoring features to be added as plugins, 
and they could be dynamically managed by language support.
--
Ramon Zarazua
Bachelor of Science in Real Time Interactive Simulation
at
Digipen Institute of technology
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090703/073816d4/attachment.sig>


More information about the KDevelop-devel mailing list