Skip to content

Commit e143e24

Browse files
committed
fix: coalesce nil start line to 1
Fixes #160
1 parent d53d8e4 commit e143e24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/next_ls/db.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ defmodule NextLS.DB do
148148
module: module
149149
} = reference
150150

151+
line = meta[:line] || 1
151152
col = meta[:column] || 0
152153

153-
{{start_line, start_column}, {end_line, end_column}} =
154-
{{meta[:line], col},
155-
{meta[:line], col + String.length(identifier |> to_string() |> String.replace("Elixir.", ""))}}
154+
{start_line, start_column} = {line, col}
155+
{end_line, end_column} = {line, line + String.length(identifier |> to_string() |> String.replace("Elixir.", ""))}
156156

157157
__query__(
158158
{conn, s.logger},

0 commit comments

Comments
 (0)