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

Lack of automatic indentation edge case in Gleam files #3

Open
1 task done
JosephTLyons opened this issue Oct 18, 2024 · 0 comments
Open
1 task done

Lack of automatic indentation edge case in Gleam files #3

JosephTLyons opened this issue Oct 18, 2024 · 0 comments

Comments

@JosephTLyons
Copy link

JosephTLyons commented Oct 18, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

In most functions, Zed adds the correct indentation when putting the cursor after the { and adding a newline

fn write(file: File, text: String) {
| <- cursor here
  io.println("\"" <> text <> "\" -> " <> file.path)
}

However, for this edge case, indentation is not applied:

fn write_to_file(
  path: String,
  file_actions: fn(File) -> Nil,
) -> Result(Nil, Nil) {
| <- cursor here
  use file <- result.try(open_file(path))
  file_actions(file)
  close_file(file)
  Ok(Nil)
}

Something about the function signature being broken across multiple lines is problematic.

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

1 participant