next-ls icon indicating copy to clipboard operation
next-ls copied to clipboard

workspace command: extract an expression to a variable

Open NJichev opened this issue 1 year ago • 0 comments

A workspace command that extracts an expression to a variable.

Example:

defmodule Example do
  def run(argument) do
    DoSomeOtherThing.run(String.split(argument, "\n"))
  end
end

Hovering the String.split expression and running the workspace command should result in something like this:

defmodule Example do
  def run(argument) do
    var = String.split(argument, "\n")
    DoSomeOtherThing.run(var)
  end
end

NJichev avatar Apr 24 '24 16:04 NJichev