DUChain: How should we support case insensitive functions?
David Nolden
david.nolden.kdevelop at art-master.de
Thu Aug 20 19:54:12 UTC 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.).
Greetings, David
More information about the KDevelop-devel
mailing list