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

Too much indentation for PPX Eliom sections #207

Closed
balat opened this issue Dec 14, 2015 · 1 comment
Closed

Too much indentation for PPX Eliom sections #207

balat opened this issue Dec 14, 2015 · 1 comment

Comments

@balat
Copy link

balat commented Dec 14, 2015

Hi,

With PPX syntax, most if the code written with Eliom is inside top-level sections like:

[%%client
    ...
]

But ocp-indent indents the contents of these sections with 4 spaces, which is way too much.

Is there a way to configure this in .ocp-indent files?
I tried ppx_stritem_ext=0 but it makes effect only inside expressions.

Thanks!

@balat
Copy link
Author

balat commented Dec 14, 2015

Update: It is not true for every line ... If the section starts with a let it is ok, but not if it starts with open or module.

@AltGr AltGr closed this as completed in b3952a7 Jun 2, 2016
AltGr added a commit that referenced this issue Jun 13, 2016
closes #207 and #211 (based for some parts of #211)

(breaks tests; ppx_expr_ext test seems to assume that the contents of a
block should be aligned with its first element; this can easily be done
with the code below (in function `append`) but doesn't seem desirable in
general, and JS tests indeed prove otherwise

    let n =
      if not starts_line then
        (* Take the leading item in the body as column reference *)
        {n with pad = 0; indent = block.toff + tok.offset; }
      else n
    in

As for the mentionned JS tests (js-syntax.ml), I have no idea how ocp-indent is
supposed to know that two consecutive exprs in `[%raise_structural_sexp`
should be aligned and are not a function application)
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