From 9864fc4567c674e1570102c250c74a5f437e8f0a Mon Sep 17 00:00:00 2001 From: Damir Vandic Date: Tue, 15 Aug 2023 00:02:17 +0200 Subject: [PATCH] fix: coalesce nil start line to 1 (#182) 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..672b6e8b 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, col + String.length(identifier |> to_string() |> String.replace("Elixir.", ""))} __query__( {conn, s.logger},