Language modes are implemented in javascript and tell ace how to provide syntax highlighting for files of a certain type. In addition a mode specifies indentation and code folding patterns and other language specific behaviors.

Language modes can be imported from a TextMate/Sublime Text Bundle or made based on one of the existing language modes.

For more information on creating language modes see the language mode guide

Header

Open mymode.js and add the following line as it's first line.

/* caption: <Language Name>; extensions: <Comma Separated List of File Extensions> */

for example:

/* caption: Javascript; extensions: js,javascript */

Adding a Language Mode to a Bundle

A bundle can contain one or more language modes. Each mode must be stored in a file called <name>.js and placed in the modes directory. Additional files such as highlight rules should be named <name>_<type>.js where type could be highlight_rules, worker, folds, behaviors and test.

Suppose your mode is called javascript.js. Your file structure will look something like this:

└─ your.plugin
    ├─ modes
    |    ├─ javascript.js
    |    ├─ javascript_highlight_rules.js
    |    ├─ javascript_test.js
    |    ├─ javascript_worker.js
    |    └─ javascript_worker_test.js
    ├─ package.json
    └─ README.md