Review Request: Allow to mark Declaration instances as "automatically created"

David Nolden david.nolden.kde at art-master.de
Thu Mar 24 10:10:39 UTC 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100936/#review2138
-----------------------------------------------------------

Ship it!


I'm also not sure if the indexForUsedDeclaration is enough, maybe it happens that during updating, this returns "true" even though the declaration is not used any more, so it might happen that unused declarations are only deleted after 2 updates instead of one.
However you should anyway filter away all declarations with "dec->isAutoDeclaration() && !dec->hasUses()" during code-completion, so this probably won't cause problems.

See the comment before pushing.


language/duchain/ducontext.cpp
<http://git.reviewboard.kde.org/r/100936/#comment1759>

    I'd simply change this to "if( !encountered.contains(dec) && ( !dec->isAutoDeclaration() || !dec->hasUses() ) )"
    


- David


On March 24, 2011, 2:04 a.m., Sven Brauch wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100936/
> -----------------------------------------------------------
> 
> (Updated March 24, 2011, 2:04 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Summary
> -------
> 
> Allow to mark Declaration instances as "automatically created", so they aren't automatically deleted if they weren't encountered while the context containing them was generated. This is useful for languages like python and php, where you can do something like "foo = A(); foo.x=3" without having defined a property named x in the class A previously.
> I'm not sure about the change in ducontext.cpp; maybe that will be too slow, I don't know.
> 
> 
> Diffs
> -----
> 
>   language/duchain/declaration.h 92e0c62 
>   language/duchain/declaration.cpp b46e4f1 
>   language/duchain/declarationdata.h 3ae64ba 
>   language/duchain/ducontext.h 9e7b75b 
>   language/duchain/ducontext.cpp 3ec527b 
>   language/duchain/repositories/itemrepository.cpp c76befd 
>   language/duchain/uses.h 7f9b90a 
>   language/duchain/uses.cpp d1fedee 
> 
> Diff: http://git.reviewboard.kde.org/r/100936/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sven
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110324/997e8b73/attachment.html>


More information about the KDevelop-devel mailing list