-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Problem Merging multiple compiler directives code #2068
Comments
Hello @Rajivhost, thank you for reporting this issue. I was able to reproduce the problem using code comments. This is a trivia issue, we don't print the comment (or in your case the fantomas/src/Fantomas/CodePrinter.fs Lines 2876 to 2880 in 896bc77
To do this, we would need to extend the fantomas/src/Fantomas/SourceParser.fs Lines 805 to 809 in 896bc77
Once this has been added, in CodePrinter you can to do something like:
Are you interested in submitting a PR for this? |
Issue created from fantomas-online
Code
Problem description
We got this error:
System.Exception: Fantomas is trying to format the input multiple times due to the detect of multiple defines.
There is a problem with merging all the code back together.
[API_GATEWAY, MADAPI] has 21 fragments
[] has 22 fragments
[API_GATEWAY] has 21 fragments
[MADAPI] has 20 fragments
Please raise an issue at https://fsprojects.github.io/fantomas-tools/#/fantomas/preview.
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\a_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
at Fantomas.CodeFormatterImpl.format@410-3.Invoke(FSharpList
1 _arg2) in /home/runner/work/fantomas-tools/fantomas-tools/.deps/fantomas/src/Fantomas/CodeFormatterImpl.fs:line 436 at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation
1 ctxt, b result1, FSharpFunc2 userCode) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 465 at Fantomas.Async.map@167-2.Invoke(AsyncActivation
1 ctxt) in /home/runner/work/fantomas-tools/fantomas-tools/.deps/fantomas/src/Fantomas/Utils.fs:line 167at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a_work\1\s\src\fsharp\FSharp.Core\async.fs:line 105
The text was updated successfully, but these errors were encountered: