elixir-tools/next-ls

code action: create function body from undefined function diagnostic

Opened this issue · 0 comments

Description

Sometimes when writing code, you might write down a function call to a function that doesn't exist yet. This will yield a compiler error that says undefined function foo_bar/2 (expected Foo.Bar to define such a function or for it to be imported, but none are available).

Solution

A code action that will create the function body for that function. It would be great to have one to create a public function and one to create a private function

In the above case, if you were to activate the action to create a public function, it would create one directly blow the function you are currently typing in and look like

  def foo_bar(param1, param2) do
  end