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

Bring Reason Syntax up to par with Refmt v3 #199

Open
ostera opened this issue Sep 24, 2018 · 0 comments

Comments

2 participants
@ostera
Copy link
Collaborator

commented Sep 24, 2018

I've been meaning to bring up the reason syntax printing on part with refmt, so I'm opening this issue to track the work that needs to be done, and we can reference it from smaller PRs until this is more or less completed.

  • Compact arguments:
    'a => 'b => 'c should be ('a, 'b) => 'c

  • Optional arguments:
    ?l: 'a => 'b should be (~l: 'a=?) => 'b

  • Long signatures should break arguments into individual lines (cc @grabbou):
    ('a, 'b, 'c, 'd, ... /* ad nauseum */) => 'z should be

(
  'a,
  'b,
  'c,
  'd,
  ...
) => 'z
  • Space around colons is normally a single space after the colon:
    • Record attribute name { a : 1 } should be { a: 1 }
    • Object attribute name { a : 1 } should be { a: 1 }
    • Function signature let f : 'a => 'b should be let f: 'a => 'b
    • Tweened Type annotations (a : unit) should be (a: unit)

If you have some more please comment below and I'll add them to the top-level list so we get some coverage 🙌

cc/ @ryyppy @aantron

@aantron aantron added the html label Sep 24, 2018

ostera added a commit to ostera/odoc that referenced this issue Sep 27, 2018

aantron added a commit that referenced this issue Sep 27, 2018

ostera added a commit to ostera/odoc that referenced this issue Sep 27, 2018

Fix all label separators
As it turns out, label separators seem to be pretty uniform within each
syntax, so I figured I'd pull that out of the `Syntax.Type` submodule
and solve it once for all of them.

Can be specialized if need be, but solves the issue for now.

Work on ocaml#199

aantron added a commit that referenced this issue Sep 27, 2018

Fix all type annotation separators in Reason syntax (#207)
As it turns out, label separators seem to be pretty uniform within each
syntax, so I figured I'd pull that out of the `Syntax.Type` submodule
and solve it once for all of them.

Can be specialized if need be, but solves the issue for now.

Work on #199

@ostera ostera referenced this issue Oct 8, 2018

Open

[meta] Roadmap #210

2 of 13 tasks complete

@aantron aantron added this to To do in Reason and BuckleScript via automation Oct 9, 2018

@aantron aantron moved this from To do to In progress in Reason and BuckleScript Oct 9, 2018

@ostera ostera moved this from In progress to To do in Reason and BuckleScript Oct 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.