add something a la CodeModelItem::visibility ?

Milian Wolff mail at milianw.de
Fri Sep 18 11:23:02 UTC 2009


Am Freitag, 18. September 2009 12:02:41 schrieb David Nolden:
> 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.

I thought it would be slow, because then, _each_ variable would fulfull the 
conditional. And not the conditional itself is a non-trivial action, but the 
stuff that happens inside, e.g. getting the parsing file, then it's duchain 
(potentially from disk) etc. etc. In my case this would lead to lots of 
unrequired work, potentially even quite a bit of IO.

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

Can I add CodeModelItem::GlobalVariable then? I think that would fulfill my 
needs perfectly.

-- 
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/20090918/a37001ef/attachment.sig>


More information about the KDevelop-devel mailing list