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

Comments in function calls get detached from the line they are commenting on #819

Open
Niols opened this issue Dec 29, 2024 · 0 comments
Open
Labels

Comments

@Niols
Copy link
Member

Niols commented Dec 29, 2024

As of f35eee4, Topiary formats:

foo
  first_argument (** explanation for first argument *)
  ~name: second_argument (** explanation for second argument *)
  third_argument
  result (** explanation for result *)
=  result

as

foo
  first_argument
  (** explanation for first argument *)
  ~name: second_argument
  (** explanation for second argument *)
  third_argument
  result (** explanation for result *)
= result

which I think might be a shame because it somewhat looses the connection between arguments and comments. Feel free to disregard this one, I'm not even sure what I think of it yet, but I wanted to have it showcased somewhere.

To reproduce:

$ nix run github:tweag/topiary/f35eee4 -- format -l ocaml <<EOF
foo
  first_argument (** explanation for first argument *)
  ~name: second_argument (** explanation for second argument *)
  third_argument
  result (** explanation for result *)
=  result
EOF
@Niols Niols added type: feature request language: ocaml OCaml formatting issues labels Dec 29, 2024
@Niols Niols changed the title Comments in function calls get detached from the line hey are commenting on Comments in function calls get detached from the line they are commenting on Jan 9, 2025
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

1 participant