Belgacem
Belgacem

Reputation: 193

How to add syntax highlighting for a new language in codemirror?

I have developed a DSL with ANLTR 4 and now I am developing a text editor for this DSL with Angular and CodeMirror and I would like to add syntax highlighting. My question is how to add syntax highlighting for a new language in codemirror.

Upvotes: 1

Views: 2062

Answers (1)

GreyBeardedGeek
GreyBeardedGeek

Reputation: 30088

Your question has nothing at all to do with Angular, so I removed that tag.

To add syntax highlighting for a new language, you need to provide a custom "language mode" for codemirror. See their documentation at https://codemirror.net/doc/manual.html#modeapi

Upvotes: 1

Related Questions