add something a la CodeModelItem::visibility ?

Milian Wolff mail at milianw.de
Sun Sep 20 21:42:14 UTC 2009


David Nolden, 20.09.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 always forget that this is done via QualifiedIdentifiers... I think many parts 
of PHP are far too complex, i.e. instead of using Foo::Bar::Asdf we get Foo, 
Bar and finally Asdf manually...

> > 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.

It also happened with findDeclarations.

> 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++.

Can I manually overwrite it on a per-declaration basis? In PHP it's possible 
to declare functions inside functions for example. Or constants as well.

I will try to make it work for me now, thanks for the input so far!
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090920/f962ad08/attachment.sig>


More information about the KDevelop-devel mailing list