Home> Products> topnavProduct.jsp> Features & Screenshots> JavaScript Editor

JavaScript Editor



RubyMine features excellent JavaScript editor for productive JavaScript programming. All of its features including code completion, error highlighting and refactoring, quick fixes and intention actions are JavaScript aware and let you productively create efficient JavaScript code.


JavaScript Code Completion

RubyMine completes keywords, labels, variables, parameters and functions, including completion in HTML event handlers.

Completion works fine for both user defined and built-in JavaScript functions.

JavaScript code completion Completion of keywords in JavaScript

JavaScript completion is DOM-based and browser-aware, which is helpful for developing scripts that are intended to run under multiple browsers.

JS DOM Completion

Code completion is also enhanced with the support for the most popular JavaScript frameworks like JQuery, YUI, Dojo, Prototype, Mootools and Bindows.


JavaScript Error & Syntax Highlighting

RubyMine is capable of highlighting JavaScript errors on-the-fly to hunt them far before your application produces an error.

Advanced syntax highlighting works fine both in standalone JavaScript (JS files) and embedded HTML JavaScript code.

Error highlighting in JavaScript Highlighting escape sequences

JavaScript Refactoring

The full range of RubyMine refactorings supports the JavaScript code. Rename file, function, variable, parameter, or label (both directly and via references, even within HTML):

Rename file, function, variable, parameter, or label (both directly and via references, even within HTML). Rename for local entities works inline, with no dialogs opened.

Extract Variable/Function: create a new variable or a function from a selected piece of code.

Inline Variable/Function: replace a variable usage(s) with its definition or a function call(s) with its body.

Move/Copy file: you can easily move a .js file to another directory, by simply pressing F6 and specifying its new location. All references to the file throughout your project will be automatically resolved.

Safe Delete file: in case you are trying to delete a .js file that referenced in other project files, RubyMine will notify you about that, giving you an opportunity to either resolve the inconsistency first, or just cancel the operation.

Safe delete

Extract inlined script from HTML into a JS file.

This refactoring is especially good when you need to reuse, say, an event handler for multiple HTML objects. It lets you extract the inlined script to a separate JS file, and replaces the inlined code with calls to the extracted script.

JavaScript Code Formatting

JavaScript code formatting

Formatting for JavaScript code is supported through customizable settings. This allows to follow almost any coding guide-lines that concern code styles. Formatting options for JavaScript are actually inherited from those for Java and are shareable.

JavaScript Code Folding

Code folding in JavaScript

To make your code view more clear to read and understand, RubyMine lets you fold certain parts of it. The Code Folding feature collapses blocks of code with a single shortcut (Ctrl + NumPad +). The folded code can be quickly seen in a popup by positioning the cursor over the grayed dots.

Advanced JavaScript Search and Navigation

RubyMine lets you search for JavaScript symbols, labels, files and shows all places in the entire project where the search item is used.

Find usages of label

Results are shown in a tree-view, with one-click navigation to the actual usages in source code, or highlighted so that you can view then while browsing the project files.

Highlight usages

Goto Declaration / Goto Symbol

Goto declaration in JavaScript

Navigation to a declaration lets you browse through the functions, variables and labels declared in your JavaScript code. Use the Ctrl + Click combination, or position the caret at a symbol usage and press Ctrl + B. This will immediately navigate you to the line of code where the label is declared.

You can use the (Ctrl + Alt + Shift + N) shortcut to navigate through symbols declared in your JavaScript code.

Goto symbol in JavaScript Goto symbol in JavaScript

Different search patterns are supported, including use of asterisk (*) and CamelHump abbreviations.

JavaScript Structure View

JavaScript Structure view

RubyMine lets you examine the logical structure of your JavaScript code. The Autoscroll to Source and Autoscroll from Source toolbar buttons keep you synchronized with the editor.


Extended Frameworks Support

The following extended JavaScript frameworks are supported: JQuery, YUI, Prototype, DoJo, MooTools, Qooxdoo, and Bindows.

Some specific features include:

  • Code completion for every framework
  • JSDoc and DoJo style type annotations support for better code completion and parameter type information
  • Quick Documentation lookup for JSDoc and DoJo style commands

Surrounding JavaScript code blocks with common constructs

The Surround With command (Ctrl + Alt + T) can be called on a selected block of JavaScript code, for quickly inserting it into a surrounding construct, like expression parentheses, if/else block, etc.

to the top

Download RubyMine (30-day fully functional evaluation).