Hello, Elixir enthusiasts!
I’m thrilled to introduce RefactorEx, a new Visual Studio Code extension designed to make refactoring your Elixir projects smoother and more efficient than ever.
What is RefactorEx?
RefactorEx simplifies your Elixir development by offering intuitive code actions for a wide range of refactorings. Whether you’re extracting functions, renaming variables, or tweaking pipelines, RefactorEx lets you refactor with confidence and speed—all without leaving your editor.
Check it out in action:
Key Features
Here are some of the many refactorings you can perform with RefactorEx:
- Functions: Extract, inline, rename, or even convert anonymous functions to regular ones.
- Variables & Constants: Extract, inline, or rename with ease.
- Aliases & Guards: Expand, merge, sort, or inline them.
- Pipelines: Introduce or remove pipes, and even add
IO.inspect
for debugging.
A complete list of available refactorings can be found in the documentation.
Why RefactorEx?
Refactoring is a core part of maintaining clean, readable, and maintainable code. RefactorEx began as part of my academic journey—specifically, my undergraduate thesis project (TCC), extending the research of my professor. My goal was to create something practical and valuable for the Elixir community, and I’m excited to share it with you now!
Get Started
- Install RefactorEx from the VS Code Marketplace.
- Open your Elixir project in VS Code.
- Highlight a code snippet or place your cursor where a refactoring is needed.
- Hit the lightbulb icon
or use the quick actions menu (
Ctrl+.
orCmd+.
).
Feedback and Contributions
Your feedback is invaluable! If you have suggestions, encounter issues, or want to contribute, please head over to the GitHub repository.
RefactorEx is a work of love, and I’d love to hear your thoughts as we continue to improve and expand it. Let me know how it works for your projects or if there’s a refactoring you’d love to see implemented next!
Happy coding!
gp-pereira
Notes
- I know there is official LSP on its way and I’m already looking into how to merge these refactorings into it.
- Although it was developed for VS Code, I think it should be pretty straight forward to connect it to other editors since it’s a LSP.