From 36d1030a71d2bce2a3109cd2978b05683400f2fa Mon Sep 17 00:00:00 2001 From: Nikola Jichev Date: Fri, 8 Mar 2024 13:03:01 +0200 Subject: [PATCH] Refactor function name to run --- lib/next_ls.ex | 2 +- lib/next_ls/commands/alias.ex | 2 +- test/next_ls/alias_test.exs | 2 +- test/next_ls/commands/alias_test.exs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/next_ls.ex b/lib/next_ls.ex index dd318620..2ef3cf4a 100644 --- a/lib/next_ls.ex +++ b/lib/next_ls.ex @@ -660,7 +660,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 diff --git a/lib/next_ls/commands/alias.ex b/lib/next_ls/commands/alias.ex index e311446b..f6b7cc76 100644 --- a/lib/next_ls/commands/alias.ex +++ b/lib/next_ls/commands/alias.ex @@ -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), diff --git a/test/next_ls/alias_test.exs b/test/next_ls/alias_test.exs index af165bef..817edddb 100644 --- a/test/next_ls/alias_test.exs +++ b/test/next_ls/alias_test.exs @@ -1,4 +1,4 @@ -defmodule NextLS.PipeTest do +defmodule NextLS.AliasTest do use ExUnit.Case, async: true import GenLSP.Test diff --git a/test/next_ls/commands/alias_test.exs b/test/next_ls/commands/alias_test.exs index 5f497a4b..bee70194 100644 --- a/test/next_ls/commands/alias_test.exs +++ b/test/next_ls/commands/alias_test.exs @@ -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 @@ -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 @@ -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 @@ -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