I've also made a pretty complex thing with shiki (shiki-twoslash which you could say is similar to torchlight but just for TS/JS)
Torchlight definitely a good chunk of work on top of shiki, and as an external API it might be much easier to work with in many non-JS ecosystems.