Just like analyzers can register for code events, an additional registration should also be available to add additional colorisations and glyph.
Edit @miloush Text based types, or formatting.
For example
A pet project of mine is complile-time analysis of formatting strings.
String.Format( "Height: {0,4,X3}, Width: {0,4,X3}, Depth: {0,4,X3} Cost: {0,4,3}", width, height, depth, cost )
To have the result be the contents be coloriszd like interpolation strings, highlight error, redundant sections.
Another example suppose you could detect JSON Strings and have that colorized also.
Can you give an example or scenario?
@miloush I've updated the original post with a couple of scenarios.
Yes. We agree. We want a customizable, and user editable, classification system. One approach we like is the idea of taking the 'SymbolSpecification' system used for naming, and use it for classification. So, for example, you could say "i want static methods colored purple, and instance methods colored vermillion". I started exploring this space and found that with a little work, we could probably get there. One issue would be that SymbolSpecifications really only support, well, symbols. When you want to do something like specify the colors for keywords, xml doc comments, and hte like, then you need to expand that greatly.
Another issue is how we effectively tie this into VS. There is an existing (admittedly terrible) system in VS for customizing colors today. I'd really like for there not to be two systems. But that would then require work from teh platform and every single language team. That greatly increases the cost of this sort of thing.
We'd definitely also like to make our colorization API publicly extensible (it's already privately extensible). It shouldn't be too hard, and hopefully we can at least do that in the near future.
This is somewhat different than symbol specifiers - this is to allow customizable coloring to override ours in contexts like strings.
@AdamSpeight2008 What is the glyph request though?
@jasonmalinowski By glyph I mean an graphic / icon, which could potentially clicked on to perform an action. Think code actions with a small icon in the editor. Also this isn't just restricted to strings, just that my example uses strings.
I'm still not getting it - where would such a glyph appear? Is this adding extensibility to something we already support, or is it a suggestion for some entirely new UI feature?
@AdamSpeight2008 You mean...like a smart tag?
@miloush Yep
Most helpful comment
Yes. We agree. We want a customizable, and user editable, classification system. One approach we like is the idea of taking the 'SymbolSpecification' system used for naming, and use it for classification. So, for example, you could say "i want static methods colored purple, and instance methods colored vermillion". I started exploring this space and found that with a little work, we could probably get there. One issue would be that SymbolSpecifications really only support, well, symbols. When you want to do something like specify the colors for keywords, xml doc comments, and hte like, then you need to expand that greatly.
Another issue is how we effectively tie this into VS. There is an existing (admittedly terrible) system in VS for customizing colors today. I'd really like for there not to be two systems. But that would then require work from teh platform and every single language team. That greatly increases the cost of this sort of thing.
We'd definitely also like to make our colorization API publicly extensible (it's already privately extensible). It shouldn't be too hard, and hopefully we can at least do that in the near future.