The solution is very simple and would require just extending the current code block implementation with tiptap's lowlight plugin. This plugin uses highlight.js which already has automatic language detection for 192 languages as well as configurable themes. It will need to be adapted to our implementation of the code block, but the current implementation is mostly just tiptap's code block extensions with a few removed options. We will need to extend current extension with language and lowlight options and it should work perfectly fine:
see how hard it is to read this code by the way