RefactorEx - Effortless Elixir Refactoring in VS Code ⚙️

That’s fantastic! @iurimateus you’re my hero!! Could also tell me where to put those functions please? Then I can write some docs for neovim users. Can you validate if it works for you as well please @dimitarvp? However I intend to still work on the project, so to receive the updates I should still make it some sort of plugin for neovim, right?

2 Likes

OK, bookmarking this comment and I’ll do it Soon™, promise. Can’t do it immediately (away from my devices).

Definitely. Or integrate well LSP’s code actions framework, that could probably be ideal.

1 Like

I don’t think it’s necessary because there’s nothing specific to the vscode extension (which just starts the server/process); imo, a config snippet (with the same approach as the extension) in the readme should suffice (eg lexical/pages/installation.md at main · lexical-lsp/lexical · GitHub).

1 Like

Someone figure out how to set this up with zed please and thanks :smiling_face_with_three_hearts:

5 Likes

how would it handle upgrades? i’m assuming you’d have to clone the repo and point to it, right?

Of course, take your time.

I’ll only actually look into this plugin after delivering the final report

amazing work

1 Like

I have a similar error right after the installation:

Info  - 14:44:28] Client is waiting server
[Error - 14:44:37] Compilation error:     warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
    \x{2502}
 51 \x{2502}     collapse_static(List.flatten(["{", elements] ++ '}'))
    \x{2502}                                                     ~
    \x{2502}
    \x{2514}\x{2500} lib/codegen.ex:51:53
...

Visual Code Version: 1.95.3 (Universal):

Version: 1.95.3 (Universal)
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.1.0

macOS: Apple M1, Sequoia 15.1.1

1 Like

After restarting VS Code, no more errors, I’ll try to play around a bit ;).

1 Like

Looks super promising but I get this error upon installing it:


[Error - 16:47:56] Compilation error: ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 672]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 344]}, {:ssl, :handle_option, 4, [file: 'ssl.erl', line: 1780]}, {:ssl, :process_options, 3, [file: 'ssl.erl', line: 1590]}, {:ssl, :handle_options, 3, [file: 'ssl.erl', line: 1537]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 549]}, {:http_transport, :connect, 4, [file: 'http_transport.erl', line: 110]}]}}}]}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.

Looks more like a firewall issue. Can you post the exact URL?

I got the [Error - 11:20:09 AM] Refactorex client: couldn't create connection to server. error after installing. Restarting VSCode triggered the server to start, so all is well. Maybe you can make the installation process less confusing if it’s possible to start the server post-extension installation?

Renaming this variable will delete the comment

(edit: reposting this to github)

I don’t see any other information in the output, and https://repo.hex.pm/installs/hex-1.x.csv is reachable from the browser.

I’m not using the most up to date elixir version though, which might be the problem:

elixir 1.8.2-otp-22
erlang 22.3.4.26

Anywhere, really. The create_autocmd call ensures it’s started only on the correct filetypes. I don’t think this is the recommended approach to setup things btw, but I didn’t research (stdio is more common).

Yes, updates are left to the user. But I assume most people use mason.nvim or similar to handle that.

1 Like