Recompiling contexts

Sven Brauch svenbrauch at
Sat Aug 27 07:09:25 UTC 2011


Maybe you never encountered the problem, I also didn't until now. I
noticed it because I append those type-hints to function arguments,
and those are lost when recreating declarations. If you don't do that,
there's no way to notice this behaviour other than reading debug
output, I think...


2011/8/27 Milian Wolff <mail at>:
> On Thursday 25 August 2011 16:00:50 Sven Brauch wrote:
>> Hi!
>> 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
>> solution).
>> 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?
> Interesting. I have no idea on how it should work but please remind me again
> these days and I'll try to see how it is done in PHP. I doubt I ever did
> something special in that regard.
> bye
> --
> Milian Wolff
> mail at
> --
> KDevelop-devel mailing list
> KDevelop-devel at

More information about the KDevelop-devel mailing list