WebStorm 6.0.1 Web Help

WebStorm provides the following inline refactorings:

Inline variable

JavaScript example

BeforeAfter
              Parenizor.method('toString', function ()
   {
        var string = '(' + this.getValue() + ')';
        return string;
    }
                            
              Parenizor.method('toString', function ()
    {
        return '(' + this.getValue() + ')';
    }
                            

PHP example

BeforeAfter
              public function getFeedObject($title, $description)
    {
      global $wgSitename, $wgContLanguageCode, $wgFeedClasses, $wgTitle;
      $feedTitle = "$wgSitename - {$title} [$wgContLanguageCode]";
      if (!isset($wgFeedClasses[$this->format]))
        return false;
      return new $wgFeedClasses[$this->format]
      ($feedTitle, htmlspecialchars());
    }
                            
              public function getFeedObject($title, $description)
    {
      global $wgSitename, $wgContLanguageCode, $wgFeedClasses, $wgTitle;
      if (!isset($wgFeedClasses[$this->format]))
        return false;
      return new $wgFeedClasses[$this->format]
      ("$wgSitename - {$title} [$wgContLanguageCode]", htmlspecialchars());
    }
                            

Inline method or function

BeforeAfter
              function
              sum(a, b){
    returna + b;
}

functionmultiplication(a, b){
    c = sum(a, b);
    d = c * c;
    returnd;
}

functiondivision(a, b){
    result = sum(a, b) / multiplication(a, b);
    returnresult;
}
                            
              function
              multiplication(a, b){
    c = a + b;
    d = c * c;
    returnd;
}

functiondivision(a, b){
    result = a + b / multiplication(a, b);
    returnresult;
}
                            
To perform the inline refactoring
  1. Place the caret in the editor at the desired symbol to be inlined.
  2. Do one of the following:
    • On the main menu or on the context menu of the selection, choose Refactor | Inline .
    • Press Ctrl+Alt+NCtrl+Alt+N.
  3. In the Inline dialog box that corresponds to the selected symbol, confirm the inline refactoring.

See Also

Procedures:

Web Resources: