Skip to content

gp-pereira/refactorex-vscode

Repository files navigation

Refactorex for VS Code

Uses the Refactorex language server to enhance VS Code with code actions to quickly refactor Elixir.

Example

Available refactorings

How to use each refactoring

Function: expand anonymous function

  • Description: expand an anonymous function from & to fn -> end syntax
  • Works on: anonymous function selection

Example

▲ top


Function: extract anonymous function

  • Description: extract the anonymous function into a private function
  • Works on: anonymous function selection

Example

▲ top


Function: extract function

  • Description: extract the selection into a private function
  • Works on: selection

Example

▲ top


Function: underscore unused args

  • Description: places an underscore in front of function args not used.
  • Works on: function definition line or function clause line

Example

▲ top


Function: use keyword syntax

  • Description: rewrite the regular function (do end) using keyword syntax (, do:)
  • Works on: function definition line

Example

▲ top


Function: use regular syntax

  • Description: rewrite the keyword function (, do:) using regular syntax (do end)
  • Works on: function definition line

Example

▲ top


Pipeline: pipe first arg

  • Description: pipe the first arg into call
  • Works on: line

Example

▲ top


Pipeline: remove pipe

  • Description: remove the pipe operator and put first arg inside call
  • Works on: pipe line

Example

▲ top


Variable: extract constant

  • Description: extract the selection into a module constant
  • Works on: selection

Example

▲ top


Releases

No releases published

Packages

No packages published