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

Calls to function only highlighted when cursor is on the first clause #1524

Open
eproxus opened this issue May 22, 2024 · 0 comments
Open

Calls to function only highlighted when cursor is on the first clause #1524

eproxus opened this issue May 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eproxus
Copy link

eproxus commented May 22, 2024

Describe the bug
A clear and concise description of what the bug is.

When putting the cursor on a function definition, Erlang LS will highlight the calls in the module. However, when putting the cursor on a function clause that is not the first, the highlighting doesn't work.

Looking at the editor's JSON-RPC logs for the language server the calls seem identical so it seems that it is on the Erlang LS side things are not working.

To Reproduce

Take e.g. the following snippet:

conn(#{req := Req0} = Conn0) ->                                        % 1
    request_body(Conn0#{method => method(cowboy_req:method(Req0))}).   % 2
                                                                       % 3
method(<<"GET">>) -> get;                                              % 4
method(<<"POST">>) -> post;                                            % 5
method(<<"DELETE">>) -> delete;                                        % 6
method(_) -> throw(501).                                               % 7

An place the cursor on anywhere on the word method on line 4-7.

Expected behavior
The call to method/1 is highlighted on line 2 regardless of which line the cursor is placed.

Actual behavior
The call to method/1 is only highlighted when the cursor is placed on line 4, but not on line 5-7.

Context

  • erlang_ls version (tag/sha): 0.52.0+build.1987.ref8700e96
  • Editor used: Zed
  • LSP client used: Zed (built-in)
@eproxus eproxus added the bug Something isn't working label May 22, 2024
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