Questions tagged [fantomas]

Fantomas is an F# source code formatter, inspired by scalariform for Scala, ocp-indent for OCaml and PythonTidy for Python

6 questions
3
votes
0 answers

F# type conflict

I am using the parseFile function from Fantomas.FCS as follows: open FSharp.Compiler.Text open Fantomas.FCS.Parse // ... let ast, errors = parseFile false (FSharp.Compiler.Text.SourceText.ofString "let mutable x = 3") [] However, the compiler says…
3
votes
2 answers

F# custom operator with 3 parameters

I found the following piece of code in the fantomas library for F#. I am having a hard time understanding this as an F# noob. From what I understand, it's a custom operator that takes 3 arguments, but why would an operator need 3 arguments? And what…
su8898
  • 1,703
  • 19
  • 23
1
vote
2 answers

Control line breaks in F# code formatted by Fantomas

I would like more control and customisation regarding where Fantomas inserts or remove a line break in the code that's formatted by Fantomas. For instance, the following function is formatted in one line but I would prefer having a line…
Romain Deneau
  • 2,841
  • 12
  • 24
1
vote
1 answer

How can I integrate Fantomas with MSBuild / dotnet CLI

I have F# solutions and projects that build using the .NET Core CLI (dotnet build). I would like to format my code using Fantomas (dotnet tool run fantomas). The problem is that Fantomas does not understand .sln or .fsproj files. This means that I…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
0
votes
1 answer

How can I install the Fantomas Tool with the latest version?

I installed the F# formatter tool, fantomas, globally and have this: dotnet tool list -g Package Id Version Commands ----------------------------------------- fantomas-tool 4.7.9 fantomas Updating as of today gives dotnet…
citykid
  • 9,916
  • 10
  • 55
  • 91
0
votes
1 answer

How can I create an F# AST for a record type definition programmatically?

For example this record: type City = { ID : string Name : string } How can I create an F# AST for a record type definition programmatically? open FSharp.Compiler.Syntax open FSharp.Compiler.Text module M = let ty = …
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245