Skip to content

Commit

Permalink
Refactor function name to run
Browse files Browse the repository at this point in the history
  • Loading branch information
NJichev committed Mar 8, 2024
1 parent 74333f1 commit 2fa58c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/next_ls.ex
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ defmodule NextLS do
position = arguments["position"]
text = lsp.assigns.documents[uri]

NextLS.Commands.Alias.refactor(%{
NextLS.Commands.Alias.run(%{
uri: uri,
text: text,
position: position
Expand Down
2 changes: 1 addition & 1 deletion lib/next_ls/commands/alias.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule NextLS.Commands.Alias do
})
end

def refactor(opts) do
def run(opts) do
with {:ok, %{text: text, uri: uri, position: position}} <- unify(opts(), Map.new(opts)),
{:ok, ast} = parse(text),
{:ok, defm} <- ASTHelpers.get_nearest_module(ast, position),
Expand Down
2 changes: 1 addition & 1 deletion test/next_ls/alias_test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule NextLS.PipeTest do
defmodule NextLS.AliasTest do
use ExUnit.Case, async: true

import GenLSP.Test
Expand Down
8 changes: 4 additions & 4 deletions test/next_ls/commands/alias_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule NextLS.Commands.AliasTest do
position = %{"line" => line, "character" => 6}

assert %WorkspaceEdit{changes: %{^uri => [edit = %TextEdit{range: range}]}} =
Alias.refactor(%{uri: uri, text: text, position: position})
Alias.run(%{uri: uri, text: text, position: position})

assert edit.new_text == expected_edit
assert range.start.line == 0
Expand Down Expand Up @@ -83,7 +83,7 @@ defmodule NextLS.Commands.AliasTest do
position = %{"line" => line, "character" => 6}

assert %WorkspaceEdit{changes: %{^uri => [edit = %TextEdit{range: range}]}} =
Alias.refactor(%{uri: uri, text: text, position: position})
Alias.run(%{uri: uri, text: text, position: position})

assert edit.new_text == expected_edit
assert range.start.line == 0
Expand Down Expand Up @@ -130,7 +130,7 @@ defmodule NextLS.Commands.AliasTest do
position = %{"line" => line, "character" => 6}

assert %WorkspaceEdit{changes: %{^uri => [edit = %TextEdit{range: range}]}} =
Alias.refactor(%{uri: uri, text: text, position: position})
Alias.run(%{uri: uri, text: text, position: position})

assert edit.new_text == expected_edit
assert range.start.line == 0
Expand Down Expand Up @@ -185,7 +185,7 @@ defmodule NextLS.Commands.AliasTest do
position = %{"line" => line, "character" => 8}

assert %WorkspaceEdit{changes: %{^uri => [edit = %TextEdit{range: range}]}} =
Alias.refactor(%{uri: uri, text: text, position: position})
Alias.run(%{uri: uri, text: text, position: position})

assert edit.new_text == expected_edit
assert range.start.line == 1
Expand Down

0 comments on commit 2fa58c5

Please sign in to comment.