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

incorrect indentation if do is on its own line #469

Open
andreyorst opened this issue Dec 7, 2020 · 3 comments
Open

incorrect indentation if do is on its own line #469

andreyorst opened this issue Dec 7, 2020 · 3 comments
Labels

Comments

@andreyorst
Copy link

andreyorst commented Dec 7, 2020

The following code:

defmodule Example do
  def foo0
  do
    "0"
  end

  def foo1
  do
    "1"
  end

  def foo2
  do
    "2"
  end
end

Is indented like this:

image

I know that do on its own line is not very common, but indentation should not grow with each definition

@jsmestad
Copy link
Contributor

jsmestad commented Dec 7, 2020

Oh that is interesting 🤔

@jsmestad
Copy link
Contributor

jsmestad commented May 17, 2021

I just hit this today writing some code so it definitely is a bug to fix. In my case I had a long line that caused this:

  def create_authorization_request(client_id, now \\ DateTime.utc_now()) 
    when is_binary(client_id) do

@andreyorst
Copy link
Author

The elixir-ts-mode package handles this case properly. I see there are plans for tree sitter support in #494 so I guess this can be closed once it's there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants