fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
760 stars 190 forks source link

Rider not able to run Fantomas version >= 6 #2958

Closed Wouter8 closed 10 months ago

Wouter8 commented 10 months ago
13:45:24.118 |T| SEND                          | :1                 | endpoint `Fantomas Host.RdFantomasModel.getFormatConfigFields` (12989754311554442976), taskId=1000004 :: send response: Faulted :: JetBrains.Rd.Tasks.RdFault: The type initializer for 'JetBrains.ReSharper.Plugins.FSharp.Fantomas.Host.FantomasCodeFormatter' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'JetBrains.ReSharper.Plugins.FSharp.Fantomas.Host.FantomasCodeFormatter' threw an exception.
 ---> JetBrains.Diagnostics.Assertion+AssertionException: FantomasAssembly
        .GetType($"{FantomasAssemblyName}.FormatConfig")
        .NotNull("FormatConfig must exist")
        .GetNestedType("FormatConfig")
   at JetBrains.Diagnostics.Assertion.Fail(String message)
   at JetBrains.ReSharper.Plugins.FSharp.Fantomas.Host.FantomasCodeFormatter.GetFormatConfigType() in Z:\BuildAgent\work\2fb6daa1ca702b37\ReSharper.FSharp\src\FSharp.Fantomas.Host\src\FantomasCodeFormatter.cs:line 104
   at JetBrains.ReSharper.Plugins.FSharp.Fantomas.Host.FantomasCodeFormatter..cctor() in Z:\BuildAgent\work\2fb6daa1ca702b37\ReSharper.FSharp\src\FSharp.Fantomas.Host\src\FantomasCodeFormatter.cs:line 112
   --- End of inner exception stack trace ---
   at JetBrains.ReSharper.Plugins.FSharp.Fantomas.Host.FantomasEndPoint.GetFormatConfigFields(Unit _) in Z:\BuildAgent\work\2fb6daa1ca702b37\ReSharper.FSharp\src\FSharp.Fantomas.Host\src\FantomasEndPoint.cs:line 45
   at JetBrains.Rd.Tasks.RdTaskEx.<>c__DisplayClass8_0`2.<Set>b__0(Lifetime _, TReq req)
   at JetBrains.Rd.Tasks.RdCall`2.OnWireReceived(UnsafeReader reader)
   --- End of inner exception stack trace ---

I tried version 6.2.0, 6.1.3, 6.0.8, and 5.2.4. All versions >= 6 do not work: image

Running Fantomas manually works as expected on all versions.

dawedawe commented 10 months ago

Hey @Wouter8, what Rider version are you using? 2023.2.1 works just fine for me with the latest Fantomas.

Wouter8 commented 10 months ago

I just updated. Turns out I'm running 2022.3.3 😨

Let me install 2023 and let you know if that indeed was the issue

Wouter8 commented 10 months ago

2023 is working just fine. Sorry for wasting your time...

dawedawe commented 10 months ago

2023 is working just fine. Sorry for wasting your time...

No worries. Enjoy it :)