{"_id":"551df5eca7e98017009e3ede","user":"54cfa8e1a8a4fd0d00b7fd1d","parentDoc":null,"category":{"_id":"551df586e52a0b23000c62b6","__v":9,"pages":["551df5bfa77fec1700f6f296","551df5c9fa7f722d00db21f0","551df5dfa77fec1700f6f298","551df5eca7e98017009e3ede","551df5f4a77fec1700f6f29a","551df5fdfa7f722d00db21f3","551df609a7e98017009e3ee0","551f3c0450a0fc210057968e","552836448962f339009a67ab"],"project":"54d53c7b23010a0d001aca0c","version":"54d5635532d98b0d00384afb","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-03T02:05:58.352Z","from_sync":false,"order":3,"slug":"cloud9-bundle","title":"Cloud9 Bundle"},"project":"54d53c7b23010a0d001aca0c","version":{"_id":"54d5635532d98b0d00384afb","project":"54d53c7b23010a0d001aca0c","__v":10,"forked_from":"54d53c7c23010a0d001aca0f","createdAt":"2015-02-07T00:59:01.934Z","releaseDate":"2015-02-07T00:59:01.934Z","categories":["54d5635632d98b0d00384afc","54d5635632d98b0d00384afd","54d5635632d98b0d00384afe","54d5635632d98b0d00384aff","54d5635632d98b0d00384b00","54d5635632d98b0d00384b01","54d5635632d98b0d00384b02","54d652097e05890d006f153e","54dd1315ca1e5219007e9daa","54e21e2b22de1c230094b147","54e68e62a43fe13500db3879","54fa1d3fe7a0ba2f00306309","551c453a23a1ee190034d19a","551df586e52a0b23000c62b6","551f39be6886f8230055f02a","55a6720751457325000e4d97"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.1.0","version":"0.1"},"__v":16,"updates":["559155c18c2c133700ad6079"],"next":{"pages":[],"description":""},"createdAt":"2015-04-03T02:07:40.810Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"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.\n\nLanguage modes can be [imported from a TextMate/Sublime Text Bundle](doc:import-a-textmate-bundle) or made based on one of the existing language modes.\n\n*For more information on creating language modes see [the language mode guide](language-mode)*\n\n# Header\n\nOpen `mymode.js` and add the following line as it's first line.\n\n```\n/* caption: <Language Name>; extensions: <Comma Separated List of File Extensions> */\n```\n\nfor example:\n```\n/* caption: Javascript; extensions: js,javascript */\n```\n\n# Adding a Language Mode to a Bundle\n\nA 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`.\n\nSuppose your mode is called `javascript.js`. Your file structure will look something like this:\n\n```\n└─ your.plugin\n    ├─ modes\n    |    ├─ javascript.js\n    |    ├─ javascript_highlight_rules.js\n    |    ├─ javascript_test.js\n    |    ├─ javascript_worker.js\n    |    └─ javascript_worker_test.js\n    ├─ package.json\n    └─ README.md\n```","excerpt":"","slug":"modes","type":"basic","title":"Modes"}
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](doc:import-a-textmate-bundle) or made based on one of the existing language modes. *For more information on creating language modes see [the language mode guide](language-mode)* # 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 ```