Sourceror.get_range

You're seeing just the function get_range, go back to Sourceror module for more information.

Specs

get_range(Macro.t()) :: range()

Gets the range used byt the given quoted expression in the source code.

The range is a map with :start and :end positions. Since the end position is normally the start of the closing token, the end position column is adjusted to reflect the real position of the end token.

iex> quoted = ~S"""
...> def foo do
...>   :ok
...> end
...> """ |> Sourceror.parse_string!()
iex> Sourceror.get_range(quoted)
%{start: [line: 1, column: 1], end: [line: 3, column: 3]}

iex> quoted = ~S"""
...> Foo.{
...>   Bar
...> }
...> """ |> Sourceror.parse_string!()
iex> Sourceror.get_range(quoted)
%{start: [line: 1, column: 1], end: [line: 3, column: 1]}