CodeModel: kind Class

David Nolden zwabel at googlemail.com
Sat Aug 16 14:06:29 UTC 2008


Am Samstag, 16. August 2008 15:45:28 schrieb Niko Sams:
> Hi,
>
> I used the new CodeModel in Php and have now the problem that type for
> classes isn't set correctly.
> This is because the Declaration is added to the CodeModel (before the
> type is set and
> so this can't work:
>       if(this->kind() == Type && type<StructureType>())
>         kind = CodeModelItem::Class;
>
> This is probably not an issue in cpp.
>
> So how can I work around this?
>
> Niko

It might also be an issue in cpp, there is no user of the code-model yet. This 
should be solved within the Declaration class. The code that puts the 
declaration into the code-model is in Declaration::setInSymbolTable.

For a simple and fast workaround, you can just call "if(decl->inSymbolTable()) 
{ decl->setInSymbolTable(false); decl->setInSymbolTable(true); }"

I have no time now, but you can either do the fix within Declaration(Move the 
code that manages the code-model from setInSymbolTable to somewhere else, and 
also execute it after setType(..) if the declaration is in the symbol table), 
or just use that workaround for now.

Greetings, David




More information about the KDevelop-devel mailing list