Recompiling contexts

Sven Brauch svenbrauch at
Thu Aug 25 14:00:50 UTC 2011


I got a problem with contexts being cleaned when recompiling. The
exact situation is this: Assume a function declaration with an
aguments context. If I insert a line before the function declaration,
everything is fine; however, when I remove that line again, the
arguments context is deleted, apparently because it can't be found at
the position where it is expected (for what I understood, the search
starts beginning from the old starting point). This causes problems,
because all the declarations in the context are being re-created then,
and I'd need them to be persistent.
It is bugging me how this is supposed to work. I assumed that magic
RangeInRevision stuff would transform the old context range to the new
one, so it can again be found at the same place. However, the new
modification revision for the context is set after the duchain
analysis is already done, so I don't see how that could work...
The comments for openContext also say something about contexts being
found by their scopeIdentifier, however if I set one for the arguments
context that doesn't solve the problem. I also would not know what
identifier to use for that context (I tried <function name> +
__arguments for testing this, but that's not really an acceptable
I'm just getting quite confused about this and it would be cool if
someone could tell me how it's supposed to work. Maybe I'm also using
the RangeInRevision "API" in a wrong way?


More information about the KDevelop-devel mailing list