-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Support directives around attributes on "and" type #2631
Conversation
Hello, thanks for taking the time to spend some time on this. At first glance, this PR is more about how we currently merge AttributeLists together in the Something like type A = B
and [<X>][<Y>][<Z>] C = D gets transformed to type A = B
and [<X; Y; Z>] C = D It is questionable if we should do this in the first place. The style guide doesn't explicitly state this and I believe Fantomas should not really transform this code. If we processed each attribute list individually, the trivia would be restored accordingly. Something like: type A = B
and
[<X>] // comment makes it multiline
[<Y>]
[<Z>]
C = D On a practical note, I'm reluctant to merge these changes as everything will change anyway in #2626. |
Hey, thanks for response.
Agreed,
Maybe we want to remove
Sounds good, #2626 moved forward during time I was working on this, and I want to look at it anyways. Wasn't aware that Project Dallas is so close to stable version :) I am closing this PR, and revisit it for v5.2 when things will be ready for it. |
Fixes #628
Minimized repro:
Main problem here was that directives after
and
keyword get linked to=
as ContentBefore, and not priinted out.This fix link directive trivia after
and
type + attribute combination to attribute node as ContentAfter.Also changing the way how attributes are printed for
and
type, so trivias are actually printed out, and handling some newline issues in this case.And fixing some related bugs, surfaced because this is probably first time when Directive is used as ContentAfter.
TODO