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

[refmt request] local open can be a bit agressive #2164

Closed
texastoland opened this issue Aug 28, 2018 · 3 comments
Closed

[refmt request] local open can be a bit agressive #2164

texastoland opened this issue Aug 28, 2018 · 3 comments

Comments

@texastoland
Copy link

texastoland commented Aug 28, 2018

I'm currently working around it with open!.

Expected:

let (--) = Belt.Array.range;
let range2D = (~w, ~h) => {
  open Array.Infix;
  0 -- (h - 1) <#> (i => i * w + 1 -- (i + 1) * w);
};

Actual:

let (--) = Belt.Array.range;
let range2D = (~w, ~h) =>
  Array.Infix.(0 -- (h - 1) <#> (i => i * w + 1 -- (i + 1) * w));
@jordwalke
Copy link
Member

See my old PR.

I think to add any more styling features like this we need to clean up stylistic attributes storage (as that PR demonstrates). Someone could rebase that part of the PR on top of master to get started.

@texastoland
Copy link
Author

texastoland commented Aug 28, 2018

I thought it must be a duplicate. Feel free to close. On an aside I find it fascinating that refmt simplifies code like solving an algebra problem. In practice it acts like a tutor. I wish there were also a "Prettier mode" where it promised to not change anything but whitespace and punctuation. I didn't want to open an issue. I assume it's a design decision and refmt should just work (™️).

@jordwalke
Copy link
Member

I also would like two modes, but it's a tradeoff in having some consistency in the ecosystem. We should keep this issue open because I'm not sure there is another issue open (just my PR).

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