shiki has a simple and straightforward integration with monaco for syntax highlighting: https://shiki.style/packages/monaco. It could replace the current hand-rolled solution. Let me know if you'd be interested in this, if yes I'll be more than happy to implement it.