Skip to content

Commit

Permalink
make document symbols provider more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Oct 1, 2023
1 parent e7c7a54 commit 3fe374e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,15 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbols do
do: Enum.map(info, &build_symbol_information_hierarchical(uri, text, &1))

defp build_symbol_information_hierarchical(uri, text, %Info{} = info) do
selection_location =
if info.selection_location && Keyword.has_key?(info.selection_location, :column) do
info.selection_location
else
info.location
end

selection_range =
location_to_range(info.selection_location || info.location, text, info.symbol)
location_to_range(selection_location, text, info.symbol)

# range must contain selection range
range =
Expand Down

0 comments on commit 3fe374e

Please sign in to comment.