add something a la CodeModelItem::visibility ?

David Nolden zwabel at googlemail.com
Fri Sep 18 10:02:41 UTC 2009


Am Donnerstag 17 September 2009 19:54:54 schrieb Milian Wolff:
> hey all, esp. david:
> 
> I'd like to extend the CodeModelItem to have a bool (or is an enum
> required?) for it's visibility.
> 
> Essentially, in PHP's code completion, we check the ::kind variable
> whether that kind is a global variable and hence needs to be added to
> the code completion model.
> 
> Problem: constants (e.g. define('foo', true);) are global, and hence
> should be added as well.
> 
> I'm a bit hesitant to add something like ` ... || item.kind ==
> CodeModelItem::Variable ` as that is potentially pretty slow... I mean
> right now the time between requesting a completion list with all
> available items and it showing up _is_ noticable... I'd rather not make
> it (potentially a lot) slower...
Why? That's a really trivial action. What makes it slow is for sure other 
things.

> If I'd had something like CodeModelItem::visibility / ::isGlobal that
> would allow me to add only item's i'd really need.
> 
> Would that be possible? Or do I have to use what is there?
>
Adding additional members is not an option. But as I said last time, there is 
still a lot of bits available in CodeModelItem::Kind. So you could for example 
add a flag CodeModelItem::Hidden to manage that info.

Greetings, David




More information about the KDevelop-devel mailing list