Custom CodeModel like Repository

David Nolden zwabel at googlemail.com
Wed Feb 17 13:02:18 UTC 2010


Am Dienstag 16 Februar 2010 18:32:23 schrieb Niko Sams:
> Hi David,
> 
> For my Php problem we talked about yesterday I think I found a pretty
> good solution.
> I created a custom Repository where I store the needed information.
> Basically I copied CodeModel, added additional needed members and
> store class declarations
> in there.
> It's blazingly fast :D
> 
> But the problem I have with it: it's a almost exact copy of CodeModel.
> 
> Do you think it's a good idea?
> 
> Do you think it is a good idea to make a generic base class and add a
> mechanism that allows
> declarations updating multiple CodeModels?

Not sure if such a base class really makes sense. Since it would have to deal 
with different data-types in each case, it would have to be a template class, 
and it would be ugly.

At some point maybe we can find a way to store additional information into the 
code-model, but we don't want it to replace the duchain, the better option 
would be making the duchain faster.

A maybe better solution for you would be to create a separate repository where 
you only store the additional information that doesn't fit into the normal 
code-model, by mapping from IndexedDeclaration to that specific information 
(like duchain/defintiions.h and duchain/definitions.cpp).

Just out of interest, what exact new members did you require in the code-
model?

Greetings, David




More information about the KDevelop-devel mailing list