haacked / Encourage

A bit of encouragment added to Visual Studio
75 stars 32 forks source link

Uses syntax highlighting? #30

Closed jimgraham closed 7 years ago

jimgraham commented 10 years ago

One of my "discouragements" has the word this in it

initialhighlight

when shown on top of a C# file, the discouragement seemed to have syntax highlighting. To confirm, I replaced my list of encouragements with nonsense that would syntax highlight

testencouragelist

and they as well seem to syntax highlight.

moresyntax

Is this by design?

haacked commented 10 years ago

LOL. Ummm, it's a feature? Hey @jaredpar, thoughts on this?

jaredpar commented 10 years ago

Hmm, the encouragement string is being displayed via ISignature::Content. It looks like Visual Studio is treating that field as code and syntax highlighting it (in versions after 2010).

I took a look at the implementation and there is no way to disable it. Encouragement could switch to using the Documentation property. But that ends up changing the display slightly by inserting a blank line at the top.

documentation_display

The blank line comes from rendering the content as empty and the documentation below it.

haacked commented 10 years ago

Hmm, right now it's not important enough for me to fix. But it seems the proper fix is not to use signatures but use adornments instead.

jaredpar commented 10 years ago

Adornments are probably the better route here. The biggest complication with them is getting the theme behavior correct. Which is unfortunately non-trivial

haacked commented 10 years ago

If it were trivial, it wouldn't be a Visual Studio Extension.

jaredpar commented 10 years ago

So true ....

haacked commented 7 years ago

I'm going to close this. If someone wants to submit a PR with an Adornment approach, I'd be all ears.