Inline Variable Refactoring for JavaScript / ActionScript

Next version of IntelliJ IDEA, code named Maia, brings you several new JavaScript and ActionScript refactorings. In this post we showcase one of them — Inline Variable, which works with local variables and ActionScript class fields.

Before Inline Variable

Pressing Control+Alt+N (default Windows keymap) replaces variable occurrences with an initializing expression.

After Inline Variable

During the inline process, IntelliJ IDEA checks if a variable can be safely replaced and warns if, for example, there are its usages inside a functional expression.

Problem detected when inlining variable

By the way, the Inline Variable refactoring also works in the left part of local variable assignment.

Enjoy developing with pleasure!

This entry was posted in New Features and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>