Prerequisites
Note
Before you start working with CoffeeScript, make sure that CoffeeScript plugin is enabled.
The plugin is bundled with IntelliJ IDEA and activated by default. If it is not, enable the plugin.
CoffeeScript support
CoffeeScript files are marked with
icon.
CoffeeScript support includes:
-
Coding assistance:
- Code completion for keywords, labels, variables, parameters and functions.
- Error and syntax highlighting.
- Code formatting and folding.
-
Code generation
- Generating code stubs based on file templates during file creation.
- Possibility to create line and block comments (Ctrl+Slash Command Slash or Ctrl+Divide Command Divide/Ctrl+Shift+Slash Control Shift Slash or Ctrl+Shift+Divide Control Shift Divide ).
-
Numerous ways to navigate through the source code, among them:
- Navigating with Structure View.
- (Ctrl+BCommand B).
- (Ctrl+Alt+BCommand Alt B) from overridden method / subclassed class.
- Advanced facilities to search through the source code.
- Running and testing.
Note
For compiling CoffeeScript to JavaScript, you need some JavaScript engine to be installed. The easiest way is to use Node.js
, which should be downloaded and installed on your machine.
There are two ways of using Node.js:
- Use NodeJS repository plugin. It should be installed and enabled.
- Define Node.js
as an external tool, as described in the section
Configuring third-party tools. This approach is helpful, when you need
facilities that are missing in the plugin, for example, the possibility to pass certain parameters as wildcards.
Executing CoffeeScript files involves:
- Possibility to preview results of CoffeeScript files compilation to JavaScript.
- Possibility to launch CoffeeScript files from the context menu.
- Run/debug configuration for NodeJS includes the possibility to use CoffeeScript plugin.
