4

I'm using ElixirLS: Elixir support and debugger JakeBecker.elixir-ls and editor.formatOnType is working just fine.

Pressing F2 to rename a variable doesn't work. There is no Output from ElixirLS.

What I've tried:

  • Using the Command Palette (Ctrl+Shift+P) - nothing useful when typing "rename".

  • Having only the one extension ElixirLS active

  • Right-clicking on a symbol to rename only lists the syntax-unaware "Change All Occurences".

  • Saving a new workspace as suggested for Python

How do I easily rename variables in Elixir with VS Code?

Tom Hale
  • 40,825
  • 36
  • 187
  • 242
  • It should work. I've checked it in my machine. You should recheck your extensions. Maybe it has some conflicts between them. – Minh-Khang Apr 14 '21 at 11:19
  • Search the Keyboard Shortcuts (Code -> Prefs -> Keyboard Shortcuts) for "Rename Symbol". Mine shows "Shift+F6", but this more or less does a find/replace with a live cursor scoped to the *entire* file, with no awareness of what is a var name vs. map key. I.e. still useless and not what you need. – Everett Apr 21 '21 at 12:34
  • @Minh-Khang are you sure you're using the same extension myself, given what Everett and the answer from eddy147 below? – Tom Hale Apr 27 '21 at 04:12
  • Sure. Try to right click to variable instead of `F2` – Minh-Khang May 01 '21 at 03:09

1 Answers1

2

ElixirLS currently does not support this feature. I have created a feature Request for it: https://github.com/elixir-lsp/elixir-ls/issues/436

eddy147
  • 4,853
  • 8
  • 38
  • 57