Skip to content

Commit a9a081d

Browse files
committed
Apply a suggestion
1 parent 06cb91a commit a9a081d

File tree

1 file changed

+2
-9
lines changed
  • apps/language_server/lib/language_server/experimental/code_mod

1 file changed

+2
-9
lines changed

apps/language_server/lib/language_server/experimental/code_mod/diff.ex

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,8 @@ defmodule ElixirLS.LanguageServer.Experimental.CodeMod.Diff do
7070

7171
defp apply_diff(:ins, {line, code_unit} = position, change, {current_line, prev_lines}) do
7272
current_line = [edit(change, line, code_unit, line, code_unit) | current_line]
73-
advance_ins(change, position, {current_line, prev_lines})
74-
end
75-
76-
defp advance_ins(<<>>, position, edits) do
77-
{position, edits}
78-
end
79-
80-
defp advance_ins(<<_c::utf8, rest::binary>>, position, edits) do
81-
advance_ins(rest, position, edits)
73+
# When inserting, the insert itself does not exist in source, so there is no need to advance
74+
{position, {current_line, prev_lines}}
8275
end
8376

8477
defp advance(<<>>, position, edits) do

0 commit comments

Comments
 (0)