In reply to Stephen Vaughan.

We are not working on Gutenberg, per se. CodeMirror for source code editing of blocks would be a good extension of Gutenberg. I doubt they would include it in the core as it is currently not accessible.

TinyMCE has a plugin that offers source code editing with CodeMirror which might work with the classic editor:
https://www.tiny.cloud/docs/plugins/advcode/

You can also insert code samples with this plugin: