Rename Assistant

Olivier JG olivier.jg at
Thu Oct 28 12:51:56 UTC 2010

On 10/28/2010 07:53 PM, David Nolden wrote:
> There's one thing wrong with the way you cast the RangeInRevision's
> from the uses() to SimpleRange's. A SimpleRange is always in the
> current document revision, while a RangeInRevision may be in some
> older revision (the revision-token is stored in the duchain, but not
> in the range), and normally you need to cast them using the functions
> from DocumentChangeTracker, or through the helper-functions from
> DUChainBase. You can use Declaration::usesCurrentRevision() to get the
> uses in the current revision, however that revision may again be
> changed if you wait too long, so if you store the ranges for a longer
> time, you should simply convert them to PersistentMovingRange after
> retrieving them.
> Greetings, David
I changed it to convert the range using transformFromLocalRevision().
WRT to using decl->context->type(), that doesn't seem to produce the 
desired results, ie, class variable decls are in the class context, and 
a Function type context contains function arguments, but not the actual 
function. Is there a case that isn't covered with what I was doing before?
(unless you didn't mean context->type()? there is no context->kind())

-Olivier JG

More information about the KDevelop-devel mailing list