shikijs / shiki

A beautiful yet powerful syntax highlighter
http://shiki.style/
MIT License
9.19k stars 330 forks source link

Bracket pair colorization #303

Open theoludwig opened 2 years ago

theoludwig commented 2 years ago

Hey! :wave:

Thanks for this awesome package, I can finally use VSCode default Dark+ theme syntax highlighting on my blog. :smile: I'm wondering if Bracket pair colorization could be added to Shiki? It has been added to VSCode natively since v1.60 with settings.json: "editor.bracketPairColorization.enabled": true.

With VSCode:

image

With Shiki

image

muenzpraeger commented 1 year ago

That should be in now with 0.12.0.

theoludwig commented 1 year ago

That should be in now with 0.12.0.

How do you enable it? It seems like it is not enabled by default? I updated to shiki@0.12.1, and there is still no bracket pair colorization. @muenzpraeger

muenzpraeger commented 1 year ago

@Divlo VSCode itself has built-in bracket-pair colorization (based on runtime inspection of the code). If that should be replicated in a non-IDE situation like here with Shiki the tmLangauge definition as well as the the used theme have to provide that information.

octref commented 1 year ago

This requires extracting the VS Code bracket pair colorization logic out and bringing it to shiki. I don't quite have the bandwidth to do it right now.