How to change the background color of a block of text?

Hello,

I'd like to change the background color of consecutive lines of text. I think the attached picture says it best.

I've been exploring the IHighlighting interface via the CyclomaticComplexity PowerToy but I'm thinking it's not going to be able to do what I want.

So, is IHighlighting the right way to go? If not, can you suggest a way to do this, or possibly another way of achieving a similar effect?

Thanks,
Josh



Attachment(s):
Highlight prototype.png
1 comment
Comment actions Permalink

Hello jbuedel,

unfortunately, this is not easy to do with ReSharper - there is no internal
support for text markers which occupy whole lines. ReSharper's current
line highlighting itself is working by re-painting parts of the editor window
which is probably what you need here, but it has no public API. However,
if you drop the requirement that your markers should span over whole lines
only, the rest should not be hard - just declare RegisterHighlighterAttribute
as below:

[assembly : RegisterHighlighter( "MyID",
"]]>",
BackgroundColor = "LightSkyBlue:Cyan",
Layer = HighlighterLayer.SELECTION - 1,
VSPriority = VSPriority.USAGES,
ErrorStripeKind = ErrorStripeKind.NONE,
ErrorStripeColorName = "Blue")]

and then use the "MyID" identifier when creating the range marker.

Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hello,

I'd like to change the background color of consecutive lines of text.
I think the attached picture says it best.

I've been exploring the IHighlighting interface via the
CyclomaticComplexity PowerToy but I'm thinking it's not going to be
able to do what I want.

So, is IHighlighting the right way to go? If not, can you suggest a
way to do this, or possibly another way of achieving a similar effect?

Thanks,
Josh



0

Please sign in to leave a comment.