Skip to content

Commit

Permalink
Simplify get_char_ident fn in rename provider
Browse files Browse the repository at this point in the history
  • Loading branch information
timgent committed Jan 24, 2023
1 parent b52042c commit f18d548
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/language_server/lib/language_server/providers/rename.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,9 @@ defmodule ElixirLS.LanguageServer.Providers.Rename do
end

defp get_char_ident(text, line, character) do
case Code.Fragment.surround_context(text, {line, character}) do
%{context: {context, char_ident}} when context in [:local_or_var, :local_call] -> char_ident
%{context: {:dot, _, char_ident}} -> char_ident
_ -> nil
case get_begin_end_and_char_ident(text, line, character) do
nil -> nil
%{char_ident: char_ident} -> char_ident
end
end

Expand Down

0 comments on commit f18d548

Please sign in to comment.