Integrate Solidity Syntax highlighting

Hey!

I´m new to CMv6 and need to integrate syntax highlighting for solidity. In the older versions I could simple import a package (in my case made by Marijn Haverbeke, import it by using
import 'codemirror/mode/solidity/solidity.js';
and then pass it to the options prop as the “mode” property.
Now it seems to be a bit different and I have no idea how to integrate it to codemirror:
There is this other public npm package right here:

But this also only seems to apply to the mode object… Any idea how I can integrate this?

That package targets CodeMirror 5.x. I’m not aware of a solidity mode for 6.x being available yet.

I found this language package for CodeMirror 6.x on npm, called @replit/codemirror-lang-solidity. The README has a sample of code that shows you how to use it in your editor.

1 Like

Oh my, how did I not find this, this is exactly what I was looking for, appreciate your help!