Refactoring CodeHighlightingInstance

Milian Wolff mail at milianw.de
Fri Dec 10 20:34:12 UTC 2010


On Friday 10 December 2010 21:10:37 Milian Wolff wrote:
> Hey David,
> 
> I need to do some changes to CodeHighlightingInstance, as it is not good
> for languages such as PHP:
> 
> a) I want rainbow colors for global variables, since you can write scripts
> (and often do) that don't use functions.
> 
> b) I don't want rainbow colorization for functions / classes / ... whatever
> inside functions. Yes that's possible in PHP, don't blame me :)
> 
> c) I want alias declarations to use the same color everywhere.
> 
> I have multiple ideas on how to solve that:

...

> or alternatively: try to refactor the whole class to make such cases
> simpler to overload and configure on a per language basis. I've yet to
> find out how though, the simplest would of course be something like
> 
> virtual bool useRainbowColor(Declaration* dec) const;
> 
> and call that for every use and declaration in *all* contexts... I'm not
> sure how much of a difference this would make speedwise, I think I'll try
> it out.

I've implemented this. Not much code to change and it just works™ without 
being noticeably slower (in my eyes, didn't do any profiling). Are you OK with 
this change?

Bye
-- 
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: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101210/63d01194/attachment.sig>


More information about the KDevelop-devel mailing list