Skip to content

Recognise eliom file extensions#1430

Merged
gpetiot merged 3 commits intoocaml-ppx:masterfrom
jrochel:eliom
Aug 5, 2020
Merged

Recognise eliom file extensions#1430
gpetiot merged 3 commits intoocaml-ppx:masterfrom
jrochel:eliom

Conversation

@jrochel
Copy link
Copy Markdown
Contributor

@jrochel jrochel commented Jul 24, 2020

No description provided.

@facebook-github-bot
Copy link
Copy Markdown

Hi @jrochel!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@gpetiot
Copy link
Copy Markdown
Collaborator

gpetiot commented Jul 31, 2020

Hi, thanks for the contribution. I've never used eliom so far, does anyone have more experience with that? (@emillon @Julow @jberdine ). I couldn't find any differences with the ocaml syntax from a few examples so far, I wonder if there is more to it.

@hhugo
Copy link
Copy Markdown
Collaborator

hhugo commented Jul 31, 2020

I think the extension is just used to drive the build system. The syntax is the plain ocaml one, the build rules are however more complicated.

@hhugo
Copy link
Copy Markdown
Collaborator

hhugo commented Jul 31, 2020

I suspect this change alone is enough. I would be nice to include some eliom file in the testsuite thought. With real life examples, to see how code look in theses cases.

@gpetiot gpetiot changed the title recognise eliom file extensions Recognise eliom file extensions Aug 3, 2020
@gpetiot
Copy link
Copy Markdown
Collaborator

gpetiot commented Aug 3, 2020

I rebased, updated the changelog and added a test from the user manual.

@jrochel
Copy link
Copy Markdown
Contributor Author

jrochel commented Aug 3, 2020

@gpetiot Marvellous, thanks!

[%%shared
type some_type = int * string list [@@deriving json]

type another_type = A of some_type | B of another_type [@@deriving json]]
Copy link
Copy Markdown
Collaborator

@hhugo hhugo Aug 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing ] is not very visible. Should one introduce a break before ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can think about making it affected by indicate-multiline-delimiters but not in this PR indeeed

@hhugo hhugo self-requested a review August 5, 2020 14:15
@gpetiot gpetiot merged commit 2c35648 into ocaml-ppx:master Aug 5, 2020
emillon added a commit to emillon/opam-repository that referenced this pull request Aug 6, 2020
CHANGES:

#### Changes

  + Do not break inline elements such as `{i blah}` in docstrings (ocaml-ppx/ocamlformat#1346, @jberdine)

  + Distinguish hash-getter from hash-comparison infix operators. Operators of the form `#**#` or `#**.` where `**` can be 0 or more operator chars are considered getter operators and are not surrounded by spaces, as opposed to regular infix operators (ocaml-ppx/ocamlformat#1376, @gpetiot)

  + Type constraint on return type of functions is now always printed before the function body (ocaml-ppx/ocamlformat#1381, ocaml-ppx/ocamlformat#1397, @gpetiot)

#### Bug fixes

  + Restore previous functionality for pre-post extension points (ocaml-ppx/ocamlformat#1342, @jberdine)

  + Fix extra break before `function` body of a `fun` (ocaml-ppx/ocamlformat#1343, @jberdine)
    Indent further args of anonymous functions (ocaml-ppx/ocamlformat#1440, @gpetiot)

  + Do not clear the emacs `*compilation*` buffer on successful reformat (ocaml-ppx/ocamlformat#1350, @jberdine)

  + Fix disabling with attributes on OCaml < 4.08 (ocaml-ppx/ocamlformat#1322, @emillon)

  + Preserve unwrapped comments by not adding artificial breaks when `wrap-comments=false` and `ocp-indent-compat=true` are set to avoid interfering with ocp-indent indentation. (ocaml-ppx/ocamlformat#1352, @gpetiot)

  + Break long literal strings at the margin (ocaml-ppx/ocamlformat#1367, @gpetiot)

  + Break after a multiline argument in an argument list (ocaml-ppx/ocamlformat#1360, @gpetiot)

  + Remove unnecessary parens around object (ocaml-ppx/ocamlformat#1379, @gpetiot)

  + Fix placement of comments on constants (ocaml-ppx/ocamlformat#1383, @gpetiot)

  + Do not escape arguments of some Odoc tags (ocaml-ppx/ocamlformat#1391, 1408, @gpetiot, @Julow)
    The characters `[]{}` must not be escaped in the arguments of `@raise`, `@author`, `@version` and others.

  + Fix missing open line between multi-line let-binding with poly-typexpr (ocaml-ppx/ocamlformat#1372, @jberdine)

  + Remove trailing space after expression when followed by an attribute and break before attributes attached to multi-line phrases (ocaml-ppx/ocamlformat#1382, @gpetiot)

  + Do not add a space to minimal comments `(* *)`, `(** *)` and `(*$ *)` (ocaml-ppx/ocamlformat#1407, @gpetiot)

  + Fix attributes position in labelled arguments type (ocaml-ppx/ocamlformat#1434, @gpetiot)

  + Add missing parens around type annotation in anonymous function (ocaml-ppx/ocamlformat#1433, @gpetiot)

  + Fix alignment of 'then' keyword in parenthesised expression (ocaml-ppx/ocamlformat#1421, @gpetiot)

#### New features

  + Support quoted extensions (added in ocaml 4.11) (ocaml-ppx/ocamlformat#1405, @gpetiot)

  + Recognise eliom file extensions (ocaml-ppx/ocamlformat#1430, @jrochel)
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

Successfully merging this pull request may close these issues.

4 participants