-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix multilines for OCaml block in .mli file #395
Fix multilines for OCaml block in .mli file #395
Conversation
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
6e9fb43
to
907eb65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @panglesd for your contribution! It looks nice and we should be able to merge it soon, there's just some small things that would be nice to improve beforehand.
Oh, as I am seeing the CI runs, can you add a changelog entry? |
`Int.min` was introduced in OCaml 4.13 Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Thanks @panglesd for your help, I'll try to bundle a few of these fixes that have PRs and make a release soon. |
CHANGES: #### Added - Report all parsing errors in Markdown files (realworldocaml/mdx#389, @NathanReb) #### Changed - Preserve indentation in multiline OCaml blocks in .mli files (realworldocaml/mdx#395, @panglesd) #### Fixed - Fixed compatibility with Cmdliner 1.1.0 (realworldocaml/mdx#371, @Leonidas-from-XIV) - Report errors and exit codes of toplevel directives (realworldocaml/mdx#382, @talex5, @Leonidas-from-XIV) - Fix block locations in error reporting (realworldocaml/mdx#389, @NathanReb) - Include the content of the line that features the `part-end` MDX directive in the output, before that line would've been dropped (realworldocaml/mdx#374, realworldocaml/mdx#387, @Leonidas-from-XIV) - Handle EINTR signal on waitpid call by restarting the syscall. (realworldocaml/mdx#409, @tmcgilchrist) - Fix parsing of multiline toplevel phrases in .mli files (realworldocaml/mdx#394, realworldocaml/mdx#397, @Leonidas-from-XIV) #### Removed - Removed warning about missing semicolons added in MDX 1.11.0 and the automatic insertion of semicolons in the corrected files introduced in MDX 2.0.0. (realworldocaml/mdx#398, @Leonidas-from-XIV)
This small PR fixes the fact that, in OCaml blocks, in .mli files, the indentation was erased to a "only 2 space relative to the opening bracket" indentation.
For instance,
was turned into
which is not ideal.
The first commit adds a test, showing the wrong behaviour,. The second commit is the patch and updates the test.
The new behaviour is the first line is indented two spaces after the opening bracket, and for other lines the indentation relative to the first one is kept, as long as they are at least as indented as the first one. In the previous example, the exact indententation would be kept.
In the test, I also added that multilines in .mli files for toplevel block does not work!