DUChain: How should we support case insensitive functions?

Milian Wolff mail at milianw.de
Mon Aug 24 02:10:34 UTC 2009


David Nolden, 20.08.2009:
> Am Donnerstag 20 August 2009 17:53:59 schrieb Milian Wolff:
> > Just did a bit more thinking:
> >
> > It would be good if we could support case-insensitivity in at least
> > functions like
> > DUContext::findDeclararations, DUContext::findLocalDeclarations,
> > PersistentSymbolTable::declarations etc. pp.
> >
> > That way I could make uses case insensitive without the need to copy too
> > much code. And I don't want to make the declarationbuilder save
> > everything in lowercase, as then camelcase'd functions etc. would be
> > all-lowercase after code-completion.
>
> Hey.. I don't have much time right now, I am working hard for my speech I
> will hold tomorrow, and then I will be on vacation for a week, so don't
> expect too much input from me in that time. :)
>
> But generally, I don't see how we could allow case-insensitive search in
> the duchain. That is simply not possible in any even half-efficient way, as
> the searching is done through the IndexedString indices.
>
> So I guess the best way would be: Create some additional declaration type,
> maybe a template like TemplateDeclaration, where you can attach an
> additional "pretty" string to each declaration. That would be the 'with
> case' string then in php, while internally everything would have a
> lower-case identity.
>
> Then before printing something to the user, you will have have to
> "prettify" it before showing by using the 'pretty' string instead of the
> identity, much like the C++ support does (It leaves out template default
> parameters, resolves typedefs when necessary, etc.).

Thanks, worked out pretty good. Of course a big diff, but well :) Sadly it 
required a commit to kdevplatform, hence alpha1 of PHP either must exclude my 
last commit or be delayed until the next kdevelop beta...

-- 
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/20090824/6b6ffc0f/attachment.sig>


More information about the KDevelop-devel mailing list