[refmt] Annotated functions
Open
Nobody has claimed this yet.
Printer
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
When I annotate a function:
type t = {x: int => int};
let _ = {
x: [@log] x => {
Js.log(x);
x;
},
};
It wraps it in parenthesis and adds additional 2 tabs to the body:
type t = {x: int => int};
let _ = {
x:
[@log]
(
x => {
Js.log(x);
x;
}
),
};
Is it possible to keep it as in initial snippet?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the annotated-function example with refmt and compare its output with the requested formatting. Trace the formatter path for annotated functions, then verify that the annotation remains in the original layout without added parentheses or indentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100