Uses the Refactorex language server to enhance VS Code with code actions to quickly refactor Elixir.
Scope | Refactoring | Target | Published? |
---|---|---|---|
alias |
Sort aliases | selection | |
alias |
Merge aliases | selection | |
alias |
Expand aliases | selection | |
constant |
Extract constant | selection | ✅ |
constant |
Inline constant | selection | ✅ |
constant |
Rename constant | selection | ✅ |
function |
Expand anonymous function | selection | ✅ |
function |
Extract anonymous function | selection | ✅ |
function |
Extract function | selection | ✅ |
function |
Inline function | selection | |
function |
Rename function | selection | |
function |
Underscore unused args | line | ✅ |
function |
Use keyword syntax | line | ✅ |
function |
Use regular syntax | line | ✅ |
guard |
Extract guard | selection | ✅ |
guard |
Inline guard | selection | |
guard |
Rename guard | selection | |
if else |
Use keyword syntax | line | ✅ |
if else |
Use regular syntax | line | ✅ |
pipeline |
Introduce IO.inspect | selection | ✅ |
pipeline |
Introduce pipe | line | ✅ |
pipeline |
Remove IO.inspect | line | ✅ |
pipeline |
Remove pipe | line | ✅ |
variable |
Extract variable | selection | ✅ |
variable |
Inline variable | selection | |
variable |
Rename variable | selection |
- Description: expand an anonymous function from & to fn -> end syntax
- Works on: anonymous function selection
- Description: extract the anonymous function into a private function
- Works on: anonymous function selection
- Description: extract the selection into a private function
- Works on: selection
- Description: places an underscore in front of function args not used.
- Works on: function definition line or function clause line
- Description: rewrite the regular function (do end) using keyword syntax (, do:)
- Works on: function definition line
- Description: rewrite the keyword function (, do:) using regular syntax (do end)
- Works on: function definition line
- Description: pipe the first arg into call
- Works on: line
- Description: remove the pipe operator and put first arg inside call
- Works on: pipe line
- Description: extract the selection into a module constant
- Works on: selection