How do I use DUChain::environmentFileForDocument ?

David Nolden zwabel at googlemail.com
Sun Sep 20 21:23:12 UTC 2009


Am Sonntag 20 September 2009 22:06:26 schrieb Milian Wolff:
> In the ctor of the PHP language support class I want to check the
>  modification revision of the PHPInternalFunctions file and, if required,
>  delete it from the duchain so it gets reparsed.
> 
> My problem is, that I don't know what to pass as ParsingEnvironment* to the
> above mentioned method...
> 
> We don't have a PHP-specific ParsingEnvironment.

That simply means that you don't use parsing-environments, and then you cannot 
use that function. It is a speedup function, that allows getting just the 
ParsingEnvironmentFile of a TopDUContext, instead of having to load the whole 
TopDUContext into memory.

You can just use documentForUrl() or however it's called. You can access the 
ParsingEnvironmentFile directly from the TopDUContext.

If it is zero, then you need to create it while creating your TopDUContexts. 
The standard-implementation contains all the standard stuff, like tracking 
modification revisions (You just need to add them).

If you use that, the duchain may automatically delete the file if it detects 
that it's not up to date.

Of course you can still do it manually in the constructor to enforce an up-to-
date version.

Greetings, David




More information about the KDevelop-devel mailing list