ReasonML Syntax Highlighting


Hey everyone! First of all, thanks for making Glitch! It’s a great platform with a super low bar to entry :smile:

I was wondering if you could add syntax highlighting support for ReasonML. I recently made a project with it on here and it would be better to work on with syntax highlighting support.

It looks like you use CodeMirror for the editor, just the the try page for Reason. It seems that the Try page uses the Rust language mode (, so maybe that would work?


Hi @rrdelaney :slight_smile:

what’s the file extension for ReasonML source files? Can you try in your browser if these two lines of code make the file highlight work correctly?

Open the webconsole while on a ReasonML source file and:

application.editor().setOption("mode", "text/x-rustsrc");
CodeMirror.autoLoadMode(application.editor(), "rust");



The extension for Reason files is .re. Looks like Rust mode worked really well for Reason :smiley:

Here’s the project link btw:!/reason-on


Hi Ryan,

we just added Rust mode to .re files :slight_smile: