next-ls
next-ls copied to clipboard
Convert a function capture lamda syntax to fn syntax
A workspace command that converts a capture syntax lambda into an fn syntax version
Example:
defmodule Example do
def run(list) do
Enum.map(list, & &1 + 1)
end
end
Using the workspace command on the capture operator will result in:
defmodule Example do
def run(list) do
Enum.map(list, fn one -> one + 1 end)
end
end
Consider the following:
- calculating the right number of parameters. a capture syntax might just say
&3
in it, which means there are at least 3 parameters