Attributes now stay where the user put them#2451
Merged
Julow merged 13 commits intoocaml-ppx:mainfrom Sep 27, 2023
Merged
Conversation
Julow
approved these changes
Sep 22, 2023
Julow
reviewed
Sep 25, 2023
By adding this assumption, the docstring handling code can be reverted to how it was before.
Julow
reviewed
Sep 27, 2023
Collaborator
Julow
left a comment
There was a problem hiding this comment.
Nice work :) A few tweaks and it's ready to merge.
| - JaneStreet profile: doesn't align infix ops with open paren (#2204, @gpetiot) | ||
| - Re-use the type let_binding from the parser instead of value_binding, improve the spacing of let-bindings regarding of having extension or comments (#2219, @gpetiot) | ||
| - The `ocamlformat` package now only contains the binary, the library is available through the `ocamlformat-lib` package (#2230, @gpetiot) | ||
| - Modules attributes are now formatted right after the `module` keyword, instead of at the end of the module definition (#2247, @emiletrotignon) |
Collaborator
There was a problem hiding this comment.
This makes me think that the attributes are moved, which is not the case. Also, future patches will not be about modules.
We used the word "preserve" for this in the past.
Perhaps it can be clearer with less explanation and a small code snippet ?
Collaborator
Author
There was a problem hiding this comment.
I think in future patches where we preserve more attributes we will edit the line instead of adding a new one, I updated with something that fits what this PR does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
used to be formatted into
This PR make it so that the user can choose between the two syntaxes, ocamlformat will not change anything.
It contains the first commit of #2247