It uses C# Compiler SDK (Roslyn) that allows to generate "something" even if the input is a mess
and then I use some heuristics to identify for example classes better, e.g by having popular classes names/substrings list and checking whether it is there - like Console, Controller, Service, DTO, Handler etc.
Of course it cannot be perfect because it has no access to the whole code, it uses just some fragment that may not even compile / be completed
but I think that you can achieve something reasonable and at worst you'll be able to tweak it manually.
The goal was bo be able to easily put C# code with VS/VSC colours on a web page and without having to use generic js colouring libs, so we can get something closer to real IDE
You can easily modify generated a few lines of CSS and have your own colours
I've been writing from the perspective where you just generate the html/css and e.g put it on your site, so your users don't need to have js enabled