Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not rename macro name and type. #72

Open
JimMoen opened this issue Jan 9, 2025 · 0 comments
Open

Can not rename macro name and type. #72

JimMoen opened this issue Jan 9, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@JimMoen
Copy link

JimMoen commented Jan 9, 2025

Describe the bug

Cannot rename macros define and type define by calling lsp-rename.
But renaming variables and functions works fine.

To Reproduce**

-module(hello).

-define(test_macro, an_atom).
-define(test_macro(V), {?test_macro, V}).

-type(some_type() :: string()).

-export([print/0]).

-spec print() -> ok.
print() ->
    Str = "Hello, world!",
    _ = ?test_macro,
    _ = ?test_macro("hello"),
    io:format(Str).


-spec print(some_type()) -> ok.
print(Str) ->
    io:format(Str).

For a simple erl file like the one above, placing the cursor on the print/0 function or the Str variable and renaming it to print_2/0 and Str1 will work fine. However, trying to rename either macro or type will fail.

image

Expected behavior

Macro definitions in hrl or erl files can also be renamed.
erlang_ls can rename Function / Variable / MacroName / TypeName correctly.

Actual behavior

A clear and concise description of what happens instead.

Context

  • ELP Version (output of elp version): 1.1.0+build-2024-12-09
  • Editor used: Emacs
  • melpa package: lsp-mode: 20250106.2151
@JimMoen JimMoen added the bug Something isn't working label Jan 9, 2025
@JimMoen JimMoen changed the title Can not rename macro name Can not rename macro name and type. Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant