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

Fantomas 2.8.1 introduces a regression where formatting with just an AST *no longer works* #321

Closed
7sharp9 opened this issue Oct 10, 2018 · 7 comments

Comments

@7sharp9
Copy link
Member

7sharp9 commented Oct 10, 2018

This is because of a change where it is assumed that source is always Some even if an empty string is used:

https://github.com/fsprojects/fantomas/blob/master/src/Fantomas/CodeFormatterImpl.fs#L353

This has the effect of making the following error always occur:

https://github.com/fsprojects/fantomas/blob/master/src/Fantomas/CodeFormatterImpl.fs#L366-L368

As you can see before this change it was possible to supply None for the source code, now this simply fails with:

Incomplete code fragment which is most likely due to parsing errors or the use of F# constructs newer than supported.

whenever just an AST is supplied.

7sharp9 pushed a commit to 7sharp9/fantomas that referenced this issue Oct 10, 2018
@jindraivanek
Copy link
Contributor

Fixed by #322.

@nojaf
Copy link
Contributor

nojaf commented Oct 10, 2018

Hi @7sharp9 , sorry for this regression. I was planning on release the next version by the end of the month.
Would that be ok, or you prefer an earlier release?

Are you using this in a open source project by any chance? Might be interesting to include in #254.

@7sharp9
Copy link
Member Author

7sharp9 commented Oct 11, 2018

@nojaf Yeah I use Fantomas in Falanx. Theres a dependency on Fantomas 2.8.1 in FsAst which I need to update to the patched version at some point.

@nojaf
Copy link
Contributor

nojaf commented Oct 11, 2018

Ok, I'll release a new version this weekend to help out falanx

@7sharp9
Copy link
Member Author

7sharp9 commented Oct 17, 2018

Any news on a new release?

@nojaf
Copy link
Contributor

nojaf commented Oct 17, 2018

Hi, sorry didn't get there yet.
As a workaround you can use the artifacts of AppVeyor, that should also work.

I'll try this evening, don't have the nuget key right now. #327

@nojaf
Copy link
Contributor

nojaf commented Oct 17, 2018

@7sharp9 2.9.0 is out.

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

No branches or pull requests

3 participants