A: 

I can't really answer how hard it is or whether there's any open source, but to get it done, you want to take a looki at Custom Text Markers. See these two articles for details:

jlew
Text markers are not a good idea for colorization, because they come with a large amount of overhead. You don't want to have to define a marker for every single token.
Scott Wisniewski
+4  A: 

To go beyond the simple keyword coloring, details on the Visual Studio Syntax coloring is defined here; and details to implement here.

These documents outline how the underlying plumbing is, well, plumbed -- and more importantly, goes into detail on how to wire in your own --

Borzio
Those are docs for defining a language service from scratch.If he did that, he would need to re-implement everything, including intellisence. That would be really expensive.
Scott Wisniewski
+3  A: 

If you want to roll your own, I'd recommend getting DXCore from DevExpress. I know you can add your own visual elements into VS2008 using this add in, and I believe it's free as well. there's a good sized community for assistance with writing your own plugins, and there may even be one already made for you.

I'm a big fan of DevExpress, and I run Refactor! and CodeRush.

ZombieSheep
+2  A: 

Get DXCore, and then start with this plugin: http://www.rorybecker.co.uk/PaintIt.html that should get you started with some code to colorize method names. Rory makes his code available, and I think he is a member here at SO...

Brian Schmitt
Yeah I'm around :) You can email me [email protected] or follow me on twitter twitter.com/rorybecker . That code is quite old now, but I am working on updating it at the moment.
Rory Becker
+8  A: 

Well as Brian has already said... My PaintIt plugin will give you some idea as to what can be done with the DXCore.

Also there are some other "Decorative plugins" on our "Community Plugin Site" and we have a decent community over in the

DevExpress IDE Tools forums if you have any specific questions.

DXCore is the framework on which RefactorPro and CodeRush are built which should give you an idea of what sort

of graphical capability they are capable of.

That said you do not need either of these tools to use the DXCore.

Everything on the Community Site is "Open Source" (So is PaintIt)

To give you an idea of how simple things are... the following code is all you need to add to a basic plugin template get the basics up and running using DXCore...

Private Sub PlugIn_EditorPaintLanguageElement(ByVal ea As DevExpress.CodeRush.Core.EditorPaintLanguageElementEventArgs) Handles Me.EditorPaintLanguageElement
    If ea.LanguageElement.ElementType = LanguageElementType.Method Then
        ea.PaintArgs.OverlayText(ea.LanguageElement.Name, _
                                 ea.LanguageElement.NameRange.Start, _
                                 Color.HotPink)
    End If
End Sub

I have created a plugin (called CR_ColorizeMemberNames) based on this code and added it to the Community Plugin Site.

The binary is available from my site here.

You need only download and install DXCore and place the binary of the plugin in the plugins folder (Defaults to C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins).. Then start VS and your method names should all be in HotPink (Lovely)

Rory Becker
Rory, I had trouble getting paintit to work, but using your code snippet I did manage to get this all hooked up (see my screen shot) thanks so much
Sam Saffron