3 ms·
Writing textmate grammars for VSCode extensions. I took over as the lead maintainer of the Godot engine VSCode extension, and one of the first things I worked o
by daelon 2y ago
Writing textmate grammars for VSCode extensions. I took over as the lead maintainer of the Godot engine VSCode extension, and one of the first things I worked on was adding syntax highlighting support for Godot 4's improvements to GDScript.
Textmate grammars are basically hundreds of nested regex snippets that recursively apply tags to regions of text. This is made worse by the fact that the grammar is written in JSON, so any escapes need to be double escaped, which means you can't easily copy your regex into something like regex101. You sort of just have to suffer until you get good at it.