Mode Plugin - Custom Syntax Highlighters


Edit: For some reason you cannot post a post on c9 with more than 1 image / link on… For this reason I posted the question with pictures and links onto github. See here:

Hi All,

So we, my friend and I, are working in a markup language we have created (Documentation Markup Language).
You can find the C9 Syntax highlighter here: -snip-.

I noticed recently that you can add plugins to and a few days ago I found the SDK -snip-.

This leads me to believe that we can use C9 plugins to implement custom syntax highlighters into C9. However there are no examples that I have found of template plugins which implement syntax highlighters

Over the past few days I have been struggling to get this working… If I go to:


I have a plugin named “abap2” (i figured to start off with that I’d just use a syntax highlighter already present in ace, as this should be easy to implement (or so I thought…))


At the top of abap2.js I have the following:


So as far as I can tell this makes sense. We have abap2.js which has the correct first line, apab2.js requires abap_highlight_rules and everything should follow from there.

When running the plugin in the IDE, if I swap to a file “myFile.abap2”, the syntax highlighter is selected from the syntaxes list, however no highlighting is present:


So here I am a bit clueless as to why this isn’t working… Has anyone managed to get custom modes to work in C9? Or are there any existing templates?



hi, are there any errors shown in the browser console?
Could you share your workspace with me, it will make finding the issue easier.


Hi there @harutyun,

There are no errors in the browser console (that I can see), no.

I have added you to the workspace.

Thanks for the help :slight_smile:

Edit: Actually, tell a lie, there are some errors it seems:

Failed to load resource: the server responded with a status of 403 (Forbidden) [OT] Joined /myFile.abap2 Failed to load resource: the server responded with a status of 403 (Forbidden)
range.js:1 Uncaught SyntaxError: Unexpected identifier
text.js:1 Uncaught SyntaxError: Unexpected identifier
oop.js:1 Uncaught SyntaxError: Unexpected identifier
lang.js:1 Uncaught SyntaxError: Unexpected identifier
abap_highlight_rules.js:103 Uncaught TypeError: Cannot read property ‘inherits’ of null
at Object.factory (abap_highlight_rules.js:103)
at activateModule (
at lookup (
at _require (
at req (
at Object.factory (abap2.js:6)
at activateModule (
at lookup (
at ()
at _require (

However reloading the plugin doesn’t cause the errors…


the issue was caused by a wrong path in require.
Modes in ace can do require("../lib/oop"), because they are inside ace folder
Modes in other locations have to use require("ace/lib/oop") instead, i have updated this in your workspace, and everything seems to work now.


Ah ha! That’s such a simple fix which is great! :slight_smile: Thank you so much for the help! I’ll upload the plugin example to github and will link it here so others have a place to start also. :slight_smile: