Skip to content

Commit

Permalink
fix selection ranges on elixir 1.16.2
Browse files Browse the repository at this point in the history
the fix for map position did not make it to the release
  • Loading branch information
lukaszsamson committed Apr 21, 2024
1 parent df03608 commit 790e18d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/language_server/lib/language_server/ast_utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ defmodule ElixirLS.LanguageServer.AstUtils do
cond do
form == :%{} ->
column =
if Version.match?(System.version(), "< 1.16.2") do
if Version.match?(System.version(), "< 1.17.0") do
# workaround elixir bug
# https://github.com/elixir-lang/elixir/commit/fd4e6b530c0e010712b06909c89820b08e49c238
column - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ defmodule ElixirLS.LanguageServer.Providers.SelectionRanges do
range(start_line, start_character, end_line, end_character) ->
start_character =
if match?({:%{}, _, _}, ast) and match?({:%, _, _}, parent_ast_from_stack) and
Version.match?(System.version(), "< 1.16.2") do
Version.match?(System.version(), "< 1.17.0") do
# workaround elixir bug
# https://github.com/elixir-lang/elixir/commit/fd4e6b530c0e010712b06909c89820b08e49c238
# undo column offset for structs inner map node
Expand Down

0 comments on commit 790e18d

Please sign in to comment.