Hey, would you mind giving me tips/information on improving the syntax highlighting for my programming language? Ive been working on the language pretty seriously for months but the vscode highlighting isnt that good still.
Sure! It's kind of a lot for a Reddit comment, but here are some resources that should get the ball rolling:
-
This is a template repo (not an actual GitHub template, so you have to do a manual find-and-replace after cloning/forking) with tooling to generate the
*.tmLanguage.json
files from TypeScript objects. This is a huge help because you can use regex literals to define the patterns (better syntax highlighting, and no more double-escaping everything!), split the grammar into multiple files, write helper functions to remove some boilerplate, etc. There's also aregex
function there that you can invoke like a tagged template to combine multiple regular expressions, like: