add something a la CodeModelItem::visibility ?

David Nolden zwabel at googlemail.com
Sun Sep 20 21:17:48 UTC 2009


Am Sonntag 20 September 2009 22:51:08 schrieb Milian Wolff:
> Woha, yes indeed that could be. But could you explain a bit more when the
> setInSymbolTable is required?

It should only be set on items that are globally visible, so for anything that 
can be addressed globally, for example through "Class::member".

> I just thought: OK, setInSymbolTable to _false_ on anything I might not
>  need during global completoin. That would class members, functions and the
>  like in my opinion, since I always do:
> 
> classContext->findLocalDeclarations(...);
> 
> But with setInSymbolTable(false) the above returns nothing. I assume the
>  doc-
> 
> comment of allLocalDeclarations talks about it:
> > Returns all local declarations
> > @param source A source-context that is needed to instantiate template-
> 
> declarations in some cases.
> 
> > If it is zero, that signalizes that missing members should not be
> 
> instantiated.
> 
> Is that what I have to use now? If so, what do I have to give as a source?
> 
Hmm findLocalDeclarations(..) should not be affected by whether the 
declarations are in the symbol-table or not. But I have added a speedup to 
"findLocalDeclarationsInternal" that uses the symbol-table also for local 
lookup, if the context is in the symbol-table.

I guess that is speedup is wrong in this case, if you do 
"setInSymbolTable(false)" on some declarations.

But you can easily workaround it, by setting "setInSymbolTable(false)" on all 
contexts that contain no globally visible declarations, instead of doing it on 
a per-declaration basis. That's how it's done in C++.

Greetings, David




More information about the KDevelop-devel mailing list