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

Fix for issue 452 #455

Merged
merged 10 commits into from
Aug 14, 2019
Merged

Fix for issue 452 #455

merged 10 commits into from
Aug 14, 2019

Conversation

JackMatusiewicz
Copy link
Contributor

There was no spacing applied between the attribute type name and its arguments. This is probably because it was assumed that they'd always be between parentheses. Now Fantomas will check to see if the arg expression for attributes is between parentheses. If it isn't then it will add a space to ensure the code generated still compiles.

let ``attributes without parentheses on expressions``() =
formatSourceString false """
[<MyValue 55>]
do ()""" config
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test for what happens if there are too many spaces in the attribute? (presumably they get stripped down to 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will also add similar tests for args in parens

@jindraivanek
Copy link
Contributor

Thanks for your contribution! ❤️

Nowadays all new changes are done in trivia branch (for upcoming Fantomas 3.0). Could you please retarget this PR to trivia branch?

@JackMatusiewicz JackMatusiewicz changed the base branch from master to trivia August 1, 2019 07:48
@jindraivanek
Copy link
Contributor

Is this ready?

src/Fantomas/Utils.fs Outdated Show resolved Hide resolved
src/Fantomas/CodePrinter.fs Outdated Show resolved Hide resolved
@nojaf nojaf merged commit ad9bd48 into fsprojects:trivia Aug 14, 2019
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