Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace command: inline a function #439

Open
NJichev opened this issue Apr 24, 2024 · 0 comments
Open

workspace command: inline a function #439

NJichev opened this issue Apr 24, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command

Comments

@NJichev
Copy link
Collaborator

NJichev commented Apr 24, 2024

A workspace command that inlines a private function in all callers

Example:

defmodule Example do
  def run(list) do
    n = 2
    fun(n)
    g = 3
  end

  defp fun(n) do
    m = n + 2
    # Calculate
    k = m + n
  end
end

Using the workspace command on either the defp fun region or in the caller should result in:

defmodule Example do
  def run() do
    n = 2
    m = n + 2
    # Calculate
    k = m + n
    g = 3
  end
end

Consider the following:

  • There can be more than one caller of the private function.
  • A private function might rename arguments different from their caller, this should be accounted for as well.
@NJichev NJichev added enhancement New feature or request workspace-command labels Apr 24, 2024
@NJichev NJichev mentioned this issue Apr 24, 2024
7 tasks
@NJichev NJichev added the good first issue Good for newcomers label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command
Projects
None yet
Development

No branches or pull requests

1 participant