Skip to content

Commit

Permalink
fix: only fetch most recent reference for that position
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Jul 31, 2023
1 parent bff4eec commit 00fbfbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/next_ls/db.ex
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ defmodule NextLS.DB do
def __query__({conn, logger}, query, args) do
args = Enum.map(args, &cast/1)

with {:error, _e} <- :esqlite3.q(conn, query, cast(args)) do
with {:error, _e} <- :esqlite3.q(conn, query, args) do
error = :esqlite3.error_info(conn).errmsg
NextLS.Logger.error(logger, error)
{:error, error}
Expand Down
5 changes: 4 additions & 1 deletion lib/next_ls/definition.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ defmodule NextLS.Definition do
AND refs.start_line <= ?
AND ? <= refs.end_line
AND refs.start_column <= ?
AND ? <= refs.end_column;
AND ? <= refs.end_column
ORDER BY refs.id desc
LIMIT 1;
""",
[file, line, line, col, col]
)
Expand Down

0 comments on commit 00fbfbf

Please sign in to comment.