Open NJichev opened 4 months ago
@NJichev i think that my expectation for this sort of refactor would be to actually inline the function with a lambda at the call sites.
so you example of
defmodule Example do
def run(list) do
Enum.map(list, &square/1)
end
defp square(x) do
x * x
end
end
would refactor to
defmodule Example do
def run(list) do
Enum.map(list, fn x -> x * x end)
end
end
A workspace command that inlines a private function
Example:
Hovering square in the
run
function should and using the workspace command should result in:Consider the following scenarios:
square(3)
should be converted to their anonymous counterpart:square.(3)