Skip to content

Commit 05afe40

Browse files
committed
Fix getting start line for last arg
1 parent 67fb06e commit 05afe40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/elixir/lib/code/comments.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,12 +810,13 @@ defmodule Code.Comments do
810810
line =
811811
case last_arg do
812812
[] -> block_start
813-
[{_key, value} | _] -> get_line(value)
814-
[first | _] -> get_line(first)
815-
{_, _, _} -> get_line(last_arg)
813+
[{_key, value} | _] -> get_end_line(value, get_line(value))
814+
[first | _] -> get_end_line(first, get_line(first))
815+
{_, _, _} -> get_end_line(last_arg, get_line(last_arg))
816816
_ -> block_start
817817
end
818818

819+
819820
{trailing_comments, comments} =
820821
split_trailing_comments(comments, line, block_end)
821822

0 commit comments

Comments
 (0)