Refactorex for VS Code
Uses the Refactorex language server to
enhance VS Code with code actions to quickly refactor Elixir.
Available refactorings
Function
Pipeline
Variable
- [x] Extract constant
- [ ] Extract variable
- [ ] Inline constant
- [ ] Inline variable
- [ ] Rename constant
- [ ] Rename variable
- [ ] Underscore long number
How to use each refactoring
Function: expand anonymous function
- Description: expand an anonymous function from & to fn -> end syntax
- Works on: anonymous function selection
▲ top
- Description: extract the anonymous function into a private function
- Works on: anonymous function selection
▲ top
- Description: extract the selection into a private function
- Works on: selection
▲ 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
▲ top
Function: use keyword syntax
- Description: rewrite the regular function (do end) using keyword syntax (, do:)
- Works on: function definition line
▲ top
Function: use regular syntax
- Description: rewrite the keyword function (, do:) using regular syntax (do end)
- Works on: function definition line
▲ top
Pipeline: pipe first arg
- Description: pipe the first arg into call
- Works on: line
▲ top
Pipeline: remove pipe
- Description: remove the pipe operator and put first arg inside call
- Works on: pipe line
▲ top
- Description: extract the selection into a module constant
- Works on: selection
▲ top
| |