From e143e24c7f9546bbda3fcf898cda5ac1af05ccc6 Mon Sep 17 00:00:00 2001 From: dvic Date: Mon, 14 Aug 2023 22:34:18 +0200 Subject: [PATCH] fix: coalesce nil start line to 1 Fixes #160 --- lib/next_ls/db.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/next_ls/db.ex b/lib/next_ls/db.ex index 10315294..7eaa6c41 100644 --- a/lib/next_ls/db.ex +++ b/lib/next_ls/db.ex @@ -148,11 +148,11 @@ defmodule NextLS.DB do module: module } = reference + line = meta[:line] || 1 col = meta[:column] || 0 - {{start_line, start_column}, {end_line, end_column}} = - {{meta[:line], col}, - {meta[:line], col + String.length(identifier |> to_string() |> String.replace("Elixir.", ""))}} + {start_line, start_column} = {line, col} + {end_line, end_column} = {line, line + String.length(identifier |> to_string() |> String.replace("Elixir.", ""))} __query__( {conn, s.logger},