Skip to content

Commit

Permalink
Use Enum.flat_map instead of for+List.flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
crbelaus committed Aug 7, 2023
1 parent 1dbcab5 commit 2abd08e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/next_ls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ defmodule NextLS do

locations =
dispatch(lsp.assigns.registry, :databases, fn databases ->
for {database, _} <- databases do
Enum.flat_map(databases, fn {database, _} ->
references =
case symbol_info(file, line, col, database) do
{:function, module, function} ->
Expand Down Expand Up @@ -223,10 +223,10 @@ defmodule NextLS do
}
}
end
end
end)
end)

{:reply, List.flatten(locations), lsp}
{:reply, locations, lsp}
end

def handle_request(%WorkspaceSymbol{params: %{query: query}}, lsp) do
Expand Down

0 comments on commit 2abd08e

Please sign in to comment.