Feature Request: Better C# XML docs highlighting

This is related to this request.

Would it be possible to add some more colour to the XML doc comments that are standard practice in the C# world? For example, this is what they currently look like in Fire:

but this is how they look in Visual Studio:

Notice the subtle colouring of the parameter names and the exception classes in quotes? I’d even push for some subtle colouring of the XML tags different from the text in between.

Would this be possible?

Possibly. I’m currently working on highlighting XML literals for Mercury, so I’ll have to embed the nested XML highlighter within the Elements source file highlighter now anyways — might as well do it for /// as well.

Thanks, logged as bugs://84445

How does this look?

bugs://84445 got closed with status fixed.

Yeah cool.

How do you control the colouring of the highlighted words? Do you expose the colours in a theme or plist somewhere?

Right now the themes are hardcoded, I’m afraid. This is in part because a lot of the drawing depends on certain color combinations to keep looking good when drawing rectangular highlights on top of them, which use transparency — current block highlights, selection, Code Completion target area, messages, etc. — and the current themes have been fine-tuned for that.

I’ve just come back to Fire after a couple of weeks hiatus and opened my project in the updated editor. Firstly, thanks for taking a crack at highlighting within XML comments.

May I make a suggestion? I think it would be better if the colour of the body of the comments is the same as normal comments (i.e: match the /// colour). I think just highlighting the tags is sufficient otherwise it becomes less clear that the XML block is a documentation block.

Compare Visual Studio:

With Fire:

I think it would be clearer if the body of the text (e.g: "Creates a new token.") was light grey rather than black.

Hmm, why? all “content” in XML is black, the element tags are gray. whats the point of having XML highlighting if only the (rather unimportant, relatively speaking) attribute names *eg “type”) stick out as black?

I guess it comes down to personal preference.

I do think there is value in just highlighting the actual tags. For example. I want to see the name of the parameters highlighted as it help to differentiate them. Also, highlighting <remarks> tags that flank the actual body of the remarks section is helpful as it separates it out from the adjacent XML nodes.

I’ll think about it. for now,. i’d rather not do two separate XML color schemes…

Appreciate the consideration :slight_smile:

1 Like