semantic-colorizer
semantic-colorizer copied to clipboard
Added control flow keywords
Lets you colorize control flow keywords similar to VSCode themes (i.e if, else, while, throw, return, etc...)
Thank you for the good work here!
So far I used the Viasfora Extension to highlight the control flow keywords.
I will have to check if your PR works. This might take a while.
No problem! Just FYI - I was originally going to use a similar method as your mostly language agnostic SemanticModel.GetSymbolInfo(node)
approach by using SemanticModel.GetOperation(node)
and then switching on IOperation.Kind
, but the OperationKind
enum and all the Operation based code has changed in very incompatible ways between the version of Roslyn you have referenced in your project and the latest versions in VS2017, so you get back enums that aren't even defined and other weird behavior.
That's why I just added VB and C# specific keyword tagging code instead. I don't think it's of much consequence as I'm fairly sure VB and C# and the only languages that the Roslyn language service really works on anyway, but if you upgrade to a newer Roslyn package let me know and I can rewrite the control keyword tagging bits to use IOperation
.
And just for fun, here's a screenshot of the tagging in action :)
Cheers!