{"_id":"55104b632dd9010d0019e144","__v":45,"project":"54d53c7b23010a0d001aca0c","user":"54d5c32a7e05890d006f150d","category":{"_id":"54d5635632d98b0d00384b01","version":"54d5635532d98b0d00384afb","project":"54d53c7b23010a0d001aca0c","pages":["54d5635732d98b0d00384b10","54d5635732d98b0d00384b11","55104b632dd9010d0019e144","55104c802dd9010d0019e146","551bd2c50d209f21006cad92","552e6fcd5d4baa0d00783691","552e73705d4baa0d00783699","567be431ee052b1700dbda49","567ef29af9ffa20d008782ff","56a8dd2470a9440d00ef5fe4"],"__v":9,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-07T00:03:52.618Z","from_sync":false,"order":11,"slug":"language-tooling","title":"Language Tooling"},"parentDoc":null,"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"},"updates":["568122794047cf0d00412138"],"next":{"pages":[],"description":""},"createdAt":"2015-03-23T17:20:35.650Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Adding New Languages\",\n  \"body\": \"This section is about adding tooling to existing languages in Cloud9. Based on Ace, Cloud9 supports [over 100](doc:language-mode#section-language-modes)! These include CoffeeScript, Dart, the Dockerfile format, Go, Powershell, and many more. To add a completely new language, a new Ace [Language Mode](doc:language-mode) is needed first.\"\n}\n[/block]\nPlugins can extend Cloud9 with a custom outline view, code completion, hinting, and what not, for any custom **language or framework**. Getting some basic things working is actually very easy. In these docs we give examples and explain how to implement these different services for any language.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/2BLu4GJBRzGpZit93JWG_outline.png\",\n        \"outline.png\",\n        \"2392\",\n        \"1018\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAll language tooling is implemented using plugin components called *Language Handlers*. Language handlers have full control of implementing services like code completion or an outline view. Cloud9 provides technology-agnostic interfaces and fully allows the use of any custom parser, analysis, server-side communications, etc. To make it easy to implement language handlers, Cloud9 also provides [outline definitions](doc:outline) in the Cloud9 Bundle and [the Jsonalyzer framework](doc:jsonalyzer-handlers) to implement specific kinds of language plugins.\n\nUnlike most Cloud9 plugins, language handlers are components that can potentially do CPU-intensive work like parsing or analyzing a file. To make sure they don't slow down or block the Cloud9 UI, they don't run in the normal browser UI thread, but in a background thread called a *[web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)*.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Language handlers are written like a standard common.js plugin, and don't use the Architect plugin format used for normal Cloud9 plugins. As they lives in a web worker, language handlers also can't access any of the plugins that live in the UI directly, but instead can only use `require()` to access other modules that live in the web worker, like [worker_util](https://docs.c9.io/api/#!/api/language.worker_util). Any communication with the UI is done using `worker_util` and events incoming from Cloud9 through the `base_handler` interface. See also [Talking to the Outside World](https://cloud9-sdk.readme.io/v0.1/docs/language-handlers#section-talking-to-the-outside-world).\\n\\nDebugging web workers can be tricky. In modern webkit browsers such as Chrome, web workers support breakpoint debugging. For other browsers, such as Firefox, you can launch Cloud9 with `?noworker=1` to run all language handlers in the UI thread to make debugging easier.\",\n  \"title\": \"Caveats of Web Workers\"\n}\n[/block]\n# What's Next!\n\n* [Language Handlers](doc:language-handlers) describes how to set up new language plugins.\n* [Jsonalyzer Handlers](doc:jsonalyzer-handlers) is about the Jsonalyzer library, which can help implement simple language plugins.\n* [Using External Language Tools](doc:existing-tools) shows how to use existing language tools that run in the workspace.\n* [Customizing Code Completers](doc:customizing-code-completers) gives a tour of some of the advanced features to create a high quality code completer.\n* [Code Completion For JavaScript Libraries](doc:code-completion-for-javascript) explains how Tern can be used to add code completion to custom JavaScript libraries.\n* [Reference Implementations](doc:complete-examples) lists full example implementations.\n\n# Related Pages\n\n* [Language Modes](doc:language-mode) describes how to define a syntax highlighter.\n* [Runners](doc:runners) and [Builders](doc:builders) describe how to define runners and builders for a language.","excerpt":"","slug":"language-tooling","type":"basic","title":"Introduction to Language Tooling"}

Introduction to Language Tooling


[block:callout] { "type": "warning", "title": "Adding New Languages", "body": "This section is about adding tooling to existing languages in Cloud9. Based on Ace, Cloud9 supports [over 100](doc:language-mode#section-language-modes)! These include CoffeeScript, Dart, the Dockerfile format, Go, Powershell, and many more. To add a completely new language, a new Ace [Language Mode](doc:language-mode) is needed first." } [/block] Plugins can extend Cloud9 with a custom outline view, code completion, hinting, and what not, for any custom **language or framework**. Getting some basic things working is actually very easy. In these docs we give examples and explain how to implement these different services for any language. [block:image] { "images": [ { "image": [ "https://files.readme.io/2BLu4GJBRzGpZit93JWG_outline.png", "outline.png", "2392", "1018", "", "" ] } ] } [/block] All language tooling is implemented using plugin components called *Language Handlers*. Language handlers have full control of implementing services like code completion or an outline view. Cloud9 provides technology-agnostic interfaces and fully allows the use of any custom parser, analysis, server-side communications, etc. To make it easy to implement language handlers, Cloud9 also provides [outline definitions](doc:outline) in the Cloud9 Bundle and [the Jsonalyzer framework](doc:jsonalyzer-handlers) to implement specific kinds of language plugins. Unlike most Cloud9 plugins, language handlers are components that can potentially do CPU-intensive work like parsing or analyzing a file. To make sure they don't slow down or block the Cloud9 UI, they don't run in the normal browser UI thread, but in a background thread called a *[web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)*. [block:callout] { "type": "info", "body": "Language handlers are written like a standard common.js plugin, and don't use the Architect plugin format used for normal Cloud9 plugins. As they lives in a web worker, language handlers also can't access any of the plugins that live in the UI directly, but instead can only use `require()` to access other modules that live in the web worker, like [worker_util](https://docs.c9.io/api/#!/api/language.worker_util). Any communication with the UI is done using `worker_util` and events incoming from Cloud9 through the `base_handler` interface. See also [Talking to the Outside World](https://cloud9-sdk.readme.io/v0.1/docs/language-handlers#section-talking-to-the-outside-world).\n\nDebugging web workers can be tricky. In modern webkit browsers such as Chrome, web workers support breakpoint debugging. For other browsers, such as Firefox, you can launch Cloud9 with `?noworker=1` to run all language handlers in the UI thread to make debugging easier.", "title": "Caveats of Web Workers" } [/block] # What's Next! * [Language Handlers](doc:language-handlers) describes how to set up new language plugins. * [Jsonalyzer Handlers](doc:jsonalyzer-handlers) is about the Jsonalyzer library, which can help implement simple language plugins. * [Using External Language Tools](doc:existing-tools) shows how to use existing language tools that run in the workspace. * [Customizing Code Completers](doc:customizing-code-completers) gives a tour of some of the advanced features to create a high quality code completer. * [Code Completion For JavaScript Libraries](doc:code-completion-for-javascript) explains how Tern can be used to add code completion to custom JavaScript libraries. * [Reference Implementations](doc:complete-examples) lists full example implementations. # Related Pages * [Language Modes](doc:language-mode) describes how to define a syntax highlighter. * [Runners](doc:runners) and [Builders](doc:builders) describe how to define runners and builders for a language.