Skip to content

Commit

Permalink
improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 7, 2024
1 parent c7cf458 commit ef84c8b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ defmodule ElixirLS.LanguageServer.Providers.SelectionRanges do
import ElixirLS.LanguageServer.Protocol
import ElixirLS.LanguageServer.RangeUtils
alias ElixirLS.LanguageServer.AstUtils
alias ElixirSense.Core.Normalized.Code, as: NormalizedCode

defp token_length(:end), do: 3
defp token_length(token) when token in [:"(", :"[", :"{", :")", :"]", :"}"], do: 1
Expand Down Expand Up @@ -402,7 +403,7 @@ defmodule ElixirLS.LanguageServer.Providers.SelectionRanges do
def ast_node_ranges(_, _, _), do: []

def surround_context_ranges(text, line, character) do
case Code.Fragment.surround_context(text, {line + 1, character + 1}) do
case NormalizedCode.Fragment.surround_context(text, {line + 1, character + 1}) do
:none ->
[]

Expand Down

0 comments on commit ef84c8b

Please sign in to comment.