-
Notifications
You must be signed in to change notification settings - Fork 6
Highlight Unison code in Markdown code blocks #21
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool initiative 👍
"type": "extensionHost" | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this belong in a contributing guide or the readme?
Sorry @ChrisPenner, I've been on vacation and mostly not at a keyboard. What Markdown extension(s) do you have installed? (I'm assuming you otherwise get syntax highlighting for e.g. The most useful info for debugging is probably getting the effective tokenization/scope info that Code has computed, which you can do by opening the command palette and selecting ![]() ![]() And then results in the text inside having the ![]() |
I was able to try it out today, huge improvement! I did get ![]() No idea though what I might have done righter than @ChrisPenner though? |
@dfreeman I do indeed get markdown highlighting for everything else. When I enable debugging here's what I see: ![]() Highlighting works for javascript blocks, (not Haskell though for some reason, maybe that's not included by default). I don't have any markdown extensions so I'd be surprised if anything was interfering there; and I tried using both the extension host and uninstall the unison plugin and using a .vsix instead; no luck. At any rate, if it's working for you and Arya and friends it appears the issue is somewhere on my end, so I'm more than happy to merge and move on. Maybe my computer will smarten up at some point in the future. Somewhat ironically, despite maintaining this extension I don't actually use VS Code very often haha. I'll get a release out for this, thanks for the contribution! |
This will highlight Unison code in appropriately-tagged code blocks in any Markdown files (including transcripts).
Fixes #20 — I happened to have an example of this for another language at hand, originally cobbled together from the official extension development docs and this example.
You could imagine doing a few other things to make this nicer, like highlighting
:hide
and friends as their own tokens or highlighting theproject/branch>
prompt differently inucm
blocks, but just gettingunison
blocks working seems like an ok starting point.Note: I also included a launch config file for running the extension in a debug Code instance, because I can never remember the incantation to do that manually and like being able to just hit F5. I'm happy to drop that if you'd rather not have it included in the repo, though.