Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added control flow keywords #27

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Added control flow keywords #27

wants to merge 5 commits into from

Conversation

mikernet
Copy link

Lets you colorize control flow keywords similar to VSCode themes (i.e if, else, while, throw, return, etc...)

@arBmind
Copy link
Member

arBmind commented Oct 22, 2018

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.

@mikernet
Copy link
Author

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 :)

image

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants