gpereira

gpereira

Hello, Elixir enthusiasts! :waving_hand:

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.

:movie_camera: Check it out in action:
RefactorEx Demo

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

  1. Install RefactorEx from the VS Code Marketplace.
  2. Open your Elixir project in VS Code.
  3. Highlight a code snippet or place your cursor where a refactoring is needed.
  4. Hit the lightbulb icon :light_bulb: or use the quick actions menu (Ctrl+. or Cmd+.).

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

  1. I know there is official LSP on its way and I’m already looking into how to merge these refactorings into it.
  2. 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.

Showing Posts 1 to 10

dimitarvp

dimitarvp

Gods, this looks amazing!

Any chance to have it as a NeoVim plugin? :pray:

15
Post #1
aifrak

aifrak

I just gave it a quick try. It is amazing!

At the first try, it did not work and I had to reload the window.

I would say RefactorEx should be a must have with ElixirLS for VSCode users.

Thank you for this VSCode extension!

gpereira

gpereira OP

Yeah, I intend to work on it in the next weeks

12
Post #3
lucasvegi

lucasvegi

Excellent work @gpereira! It is a great satisfaction to see the work I have been doing over the last few years turning into a practical application for the community!

gpereira

gpereira OP

You’re one of the main inspirations for this project and without your groundwork it would have taken way longer to build it, so I can’t thank you enough. :handshake:

10
Post #5
mhanberg

mhanberg

Expert LSP Core Team

Congratulations! This has been a long time coming.

I am personally proud that GenLSP was able to be used for another language server!

As we move forward with the new official LSP, I plan on working with Gabriel to integrate his refactorings into it.

Congrats again! Awesome project.

29
Post #6
gpereira

gpereira OP

Oh thanks, that means a lot coming from you and I’m super excited to work with the LSP team!

Eiji

Eiji

Amazing! :heart_eyes:

adolfont

adolfont

Hi, Gabriel. // fixed.. sorry
Congrats!

I wasn’t able to try RecaftorEx.
Maybe you can help me:

[Info  - 4:13:40 PM] Client is waiting server
[Error - 4:13:40 PM] Compilation error: /home/adolfo/.asdf/lib/commands/command-exec.bash: line 31: with_shim_executable: command not found

[Error - 4:13:40 PM] Refactorex client: couldn't create connection to server.
Error: Compilation error: /home/adolfo/.asdf/lib/commands/command-exec.bash: line 31: with_shim_executable: command not found

	at /mnt/windows/__LINUX/home/adolfo/.vscode/extensions/gp-pereira.refatorex-0.1.24/out/extension.js:62:20
	at ChildProcess.exithandler (node:child_process:415:7)
	at ChildProcess.emit (node:events:519:28)
	at maybeClose (node:internal/child_process:1105:16)
	at Socket.<anonymous> (node:internal/child_process:457:11)
	at Socket.emit (node:events:519:28)
	at Pipe.<anonymous> (node:net:339:12)

I am not sure it is RefactorEx fault.

zachdaniel

zachdaniel

Creator of Ash

Woah! This is awesome! We’ve built some refactor tools into igniter, our generator and project patching tool, I’m wondering if there is an opportunity to collaborate here? There is a huge intersection in what the two libraries are doing, although ours works on a sort of “virtual” file system via rewrite. Igniter is also based on sourceror.

One of our goals with igniter is to make these accessible outside of the context of an editor, so that they can be scripted, shared and standardized.

Where Next? Top

Trending in Announcing Top

wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
fuelen
Hi all! I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas. You...
New

Other Trending Topics Top

mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
lawik
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./ The firs...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews