Embedded SQL highlighting in Neovim, a look into Treesitter, and some NixOS patching (opens in new tab)
This is the story of the rabbit hole I went down because I wanted pretty syntax highlighting for embedded SQL queries in my Rust code. I’m a fan of sqlx, which provides macros for writing inline SQL with real-time type checking. Because the queries are in Rust strings the whole query is highlighted uniform green by default. That’s not acceptable! By the end of my journey I had highlighting looking like this: In most cases this kind of embedded syntax highlighting is easy in Neovim, and it’s o...
Read the original article