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

Go-to-definition for variables behaves incorrectly #1337

Closed
robertoaloi opened this issue Jun 14, 2022 · 0 comments · Fixed by #1403
Closed

Go-to-definition for variables behaves incorrectly #1337

robertoaloi opened this issue Jun 14, 2022 · 0 comments · Fixed by #1403
Labels
bug Something isn't working

Comments

@robertoaloi
Copy link
Member

Given the following examples, where the ~ represents the cursor location:

one() ->
    Var = 1,
    [V~ar || Var <- [1, 2, 3]].
     
two() ->
    [ Var || Var <- [1, 2, 3] ],
    [ V~ar || Var <- [4, 5, 6] ].

Go-to-definition jumps to the locations indicated by *:

one() ->
    *Var = 1,
    [Var || Var <- [1, 2, 3]].
     
two() ->
    [ *Var || Var <- [1, 2, 3] ],
    [ Var || Var <- [4, 5, 6] ].

Which is surprising for the user. Instead, they should jump to:

one() ->
    Var = 1,
    [Var || *Var <- [1, 2, 3]].
     
two() ->
    [ Var || Var <- [1, 2, 3] ],
    [ Var || *Var <- [4, 5, 6] ].
@robertoaloi robertoaloi added the bug Something isn't working label Jun 15, 2022
plux added a commit to plux/erlang_ls that referenced this issue Nov 8, 2022
plux added a commit to plux/erlang_ls that referenced this issue Nov 8, 2022
plux added a commit to plux/erlang_ls that referenced this issue Dec 20, 2023
shuying2244 pushed a commit to shuying2244/erlang_ls that referenced this issue Dec 30, 2023
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

Successfully merging a pull request may close this issue.

1 participant