Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add support for renaming modules.
Put cursor at modname in
-module(modname)
, and trigger the rename command.This will rename the .erl file (in the same directory), updated the -module attribute
and update references to the module such as:
This PR also improves the "find references" functionality for modules, previously it only displayed function references.
There's a small race condition with Emacs
erlang-mode
as it wants to be helpful and suggest that the old filename doesn't match the new module name, you need to answer no when it asks if it should fix the module name.Personally I have now disabled that check:
(setq erlang-check-module-name nil)
This feature could be handled by erlang_ls with a code action instead as
we already have a diagnostic to check the module name.
Could be a good beginner task 👍