Skip to content

Commit c1ad9ef

Browse files
committed
normalize call column to be column of fun name
before it was . column for remote calls and column of fun name for local
1 parent 0104531 commit c1ad9ef

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

lib/elixir_sense/core/metadata_builder.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
647647
case concat_module_expression(state, module_expression) do
648648
{:ok, module} ->
649649
state
650-
|> add_call_to_line({module, call, length(params)}, line, col)
650+
|> add_call_to_line({module, call, length(params)}, line, col + 1)
651651
|> add_current_env_to_line(line)
652652

653653
:error ->
@@ -664,7 +664,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
664664
module = get_current_module(state)
665665

666666
state
667-
|> add_call_to_line({module, call, length(params)}, line, col)
667+
|> add_call_to_line({module, call, length(params)}, line, col + 1)
668668
|> add_current_env_to_line(line)
669669
|> result(ast)
670670
end
@@ -675,7 +675,7 @@ defmodule ElixirSense.Core.MetadataBuilder do
675675
)
676676
when is_atom(module) and is_call(call, params) do
677677
state
678-
|> add_call_to_line({module, call, length(params)}, line, col)
678+
|> add_call_to_line({module, call, length(params)}, line, col + 1)
679679
|> add_current_env_to_line(line)
680680
|> result(ast)
681681
end

test/elixir_sense/core/metadata_builder_test.exs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,10 +2165,10 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
21652165
|> string_to_state
21662166

21672167
assert state.calls == %{
2168-
5 => [%{arity: 0, col: 15, func: :func1, line: 5, mod: NyModule}],
2169-
6 => [%{arity: 0, col: 15, func: :func1, line: 6, mod: NyModule}],
2170-
7 => [%{arity: 1, col: 15, func: :func2, line: 7, mod: NyModule}],
2171-
8 => [%{arity: 1, col: 19, func: :func2, line: 8, mod: NyModule.Sub}]
2168+
5 => [%{arity: 0, col: 16, func: :func1, line: 5, mod: NyModule}],
2169+
6 => [%{arity: 0, col: 16, func: :func1, line: 6, mod: NyModule}],
2170+
7 => [%{arity: 1, col: 16, func: :func2, line: 7, mod: NyModule}],
2171+
8 => [%{arity: 1, col: 20, func: :func2, line: 8, mod: NyModule.Sub}]
21722172
}
21732173
end
21742174

@@ -2186,9 +2186,9 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
21862186
|> string_to_state
21872187

21882188
assert state.calls == %{
2189-
3 => [%{arity: 0, col: 13, func: :func1, line: 3, mod: :erl_mod}],
2190-
4 => [%{arity: 0, col: 13, func: :func1, line: 4, mod: :erl_mod}],
2191-
5 => [%{arity: 1, col: 13, func: :func2, line: 5, mod: :erl_mod}]
2189+
3 => [%{arity: 0, col: 14, func: :func1, line: 3, mod: :erl_mod}],
2190+
4 => [%{arity: 0, col: 14, func: :func1, line: 4, mod: :erl_mod}],
2191+
5 => [%{arity: 1, col: 14, func: :func2, line: 5, mod: :erl_mod}]
21922192
}
21932193
end
21942194

@@ -2206,9 +2206,9 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
22062206
|> string_to_state
22072207

22082208
assert state.calls == %{
2209-
3 => [%{arity: 0, col: 20, func: :func1, line: 3, mod: MyMod}],
2210-
4 => [%{arity: 0, col: 20, func: :func1, line: 4, mod: MyMod}],
2211-
5 => [%{arity: 1, col: 20, func: :func2, line: 5, mod: MyMod}]
2209+
3 => [%{arity: 0, col: 21, func: :func1, line: 3, mod: MyMod}],
2210+
4 => [%{arity: 0, col: 21, func: :func1, line: 4, mod: MyMod}],
2211+
5 => [%{arity: 1, col: 21, func: :func2, line: 5, mod: MyMod}]
22122212
}
22132213
end
22142214

@@ -2223,7 +2223,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
22232223
"""
22242224
|> string_to_state
22252225

2226-
assert state.calls == %{3 => [%{arity: 0, col: 10, func: :func, line: 3, mod: MyMod}]}
2226+
assert state.calls == %{3 => [%{arity: 0, col: 11, func: :func, line: 3, mod: MyMod}]}
22272227
end
22282228

22292229
test "registers calls no arg" do
@@ -2237,7 +2237,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
22372237
"""
22382238
|> string_to_state
22392239

2240-
assert state.calls == %{3 => [%{arity: 0, col: 10, func: :func, line: 3, mod: MyMod}]}
2240+
assert state.calls == %{3 => [%{arity: 0, col: 11, func: :func, line: 3, mod: MyMod}]}
22412241
end
22422242

22432243
test "registers calls local no arg no parens" do
@@ -2293,7 +2293,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
22932293
"""
22942294
|> string_to_state
22952295

2296-
assert state.calls == %{3 => [%{arity: 1, col: 10, func: :func, line: 3, mod: MyMod}]}
2296+
assert state.calls == %{3 => [%{arity: 1, col: 11, func: :func, line: 3, mod: MyMod}]}
22972297
end
22982298

22992299
test "registers calls pipe with __MODULE__ operator no parens" do
@@ -2307,7 +2307,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23072307
"""
23082308
|> string_to_state
23092309

2310-
assert state.calls == %{3 => [%{arity: 1, col: 25, func: :func, line: 3, mod: NyModule}]}
2310+
assert state.calls == %{3 => [%{arity: 1, col: 26, func: :func, line: 3, mod: NyModule}]}
23112311
end
23122312

23132313
test "registers calls pipe operator no parens" do
@@ -2321,7 +2321,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23212321
"""
23222322
|> string_to_state
23232323

2324-
assert state.calls == %{3 => [%{arity: 1, col: 20, func: :func, line: 3, mod: MyMod}]}
2324+
assert state.calls == %{3 => [%{arity: 1, col: 21, func: :func, line: 3, mod: MyMod}]}
23252325
end
23262326

23272327
test "registers calls pipe operator" do
@@ -2335,7 +2335,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23352335
"""
23362336
|> string_to_state
23372337

2338-
assert state.calls == %{3 => [%{arity: 1, col: 20, func: :func, line: 3, mod: MyMod}]}
2338+
assert state.calls == %{3 => [%{arity: 1, col: 21, func: :func, line: 3, mod: MyMod}]}
23392339
end
23402340

23412341
test "registers calls pipe operator with arg" do
@@ -2349,7 +2349,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23492349
"""
23502350
|> string_to_state
23512351

2352-
assert state.calls == %{3 => [%{arity: 2, col: 20, func: :func, line: 3, mod: MyMod}]}
2352+
assert state.calls == %{3 => [%{arity: 2, col: 21, func: :func, line: 3, mod: MyMod}]}
23532353
end
23542354

23552355
test "registers calls pipe operator erlang module" do
@@ -2363,7 +2363,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23632363
"""
23642364
|> string_to_state
23652365

2366-
assert state.calls == %{3 => [%{arity: 2, col: 22, func: :func, line: 3, mod: :my_mod}]}
2366+
assert state.calls == %{3 => [%{arity: 2, col: 23, func: :func, line: 3, mod: :my_mod}]}
23672367
end
23682368

23692369
test "registers calls pipe operator atom module" do
@@ -2377,7 +2377,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
23772377
"""
23782378
|> string_to_state
23792379

2380-
assert state.calls == %{3 => [%{arity: 2, col: 30, func: :func, line: 3, mod: MyMod}]}
2380+
assert state.calls == %{3 => [%{arity: 2, col: 31, func: :func, line: 3, mod: MyMod}]}
23812381
end
23822382

23832383
test "registers calls pipe operator local" do
@@ -2407,7 +2407,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
24072407

24082408
assert state.calls == %{
24092409
3 => [
2410-
%{arity: 1, col: 20, func: :func, line: 3, mod: MyMod},
2410+
%{arity: 1, col: 21, func: :func, line: 3, mod: MyMod},
24112411
%{arity: 1, col: 31, func: :other, line: 3, mod: nil}
24122412
]
24132413
}
@@ -2426,8 +2426,8 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
24262426

24272427
assert state.calls == %{
24282428
3 => [
2429-
%{arity: 1, col: 20, func: :func, line: 3, mod: MyMod},
2430-
%{arity: 1, col: 36, func: :other, line: 3, mod: Other}
2429+
%{arity: 1, col: 21, func: :func, line: 3, mod: MyMod},
2430+
%{arity: 1, col: 37, func: :other, line: 3, mod: Other}
24312431
]
24322432
}
24332433
end
@@ -2446,7 +2446,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
24462446
assert state.calls == %{
24472447
3 => [
24482448
%{arity: 1, col: 15, func: :func_1, line: 3, mod: nil},
2449-
%{arity: 1, col: 31, func: :other, line: 3, mod: Some}
2449+
%{arity: 1, col: 32, func: :other, line: 3, mod: Some}
24502450
]
24512451
}
24522452
end
@@ -2483,8 +2483,8 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
24832483
|> string_to_state
24842484

24852485
assert state.calls == %{
2486-
3 => [%{arity: 1, col: 16, func: :func, line: 3, mod: NyModule}],
2487-
4 => [%{arity: 1, col: 20, func: :func, line: 4, mod: NyModule.Sub}]
2486+
3 => [%{arity: 1, col: 17, func: :func, line: 3, mod: NyModule}],
2487+
4 => [%{arity: 1, col: 21, func: :func, line: 4, mod: NyModule.Sub}]
24882488
}
24892489
end
24902490

@@ -2499,7 +2499,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
24992499
"""
25002500
|> string_to_state
25012501

2502-
assert state.calls == %{3 => [%{arity: 1, col: 11, func: :func, line: 3, mod: MyMod}]}
2502+
assert state.calls == %{3 => [%{arity: 1, col: 12, func: :func, line: 3, mod: MyMod}]}
25032503
end
25042504

25052505
test "registers calls capture operator external erlang module" do
@@ -2513,7 +2513,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
25132513
"""
25142514
|> string_to_state
25152515

2516-
assert state.calls == %{3 => [%{arity: 1, col: 14, func: :func, line: 3, mod: :erl_mod}]}
2516+
assert state.calls == %{3 => [%{arity: 1, col: 15, func: :func, line: 3, mod: :erl_mod}]}
25172517
end
25182518

25192519
test "registers calls capture operator external atom module" do
@@ -2527,7 +2527,7 @@ defmodule ElixirSense.Core.MetadataBuilderTest do
25272527
"""
25282528
|> string_to_state
25292529

2530-
assert state.calls == %{3 => [%{arity: 1, col: 21, func: :func, line: 3, mod: MyMod}]}
2530+
assert state.calls == %{3 => [%{arity: 1, col: 22, func: :func, line: 3, mod: MyMod}]}
25312531
end
25322532

25332533
test "registers calls capture operator local" do

0 commit comments

Comments
 (0)