erlang_ls
erlang_ls copied to clipboard
Go-to-definition for variables behaves incorrectly
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] ].