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

Weird indentation with type inference on methods #230

Open
simonbromberg opened this issue Nov 25, 2020 · 1 comment
Open

Weird indentation with type inference on methods #230

simonbromberg opened this issue Nov 25, 2020 · 1 comment

Comments

@simonbromberg
Copy link

What is the issue
Swimat's indentation seems to behave incorrectly with lines beginning with . which are inferring a type.

For example:

func myFunction() -> MyClass {
        .init(
        myParam: someValue
    )
}

If it were MyClass above instead of .init the indentation works as expected, but it's nicer to use type inference.

Even a single line indents too much:

func myFunction() -> UIView {
		.init(frame: .zero)
}

Expected behavior

func myFunction() -> MyClass {
    .init(
        myParam: someValue
    )
}

Desktop (please complete the following information):

  • OS: macOS 11.0.1 (20B50)
  • App Version 1.70

Additional context
Does this in the Preview tool of the Swimat macOS app too.

@frederickjjoubert
Copy link

frederickjjoubert commented Apr 13, 2021

I'm getting the same thing with single lines being indented too much:


init() {
    UINavigationBar.appearance().largeTitleTextAttributes = [
            .foregroundColor: UIColor.white // This line is indented twice
    ]
}

Thanks for the awesome tool @Swimat team, can't wait for more improvements

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

No branches or pull requests

2 participants