Formatting F# source code
summary
Explains how Fantomas actually formats F# by combining the F# compiler tokenizer + untyped AST, attaching trivia tokens (comments, newlines) back to AST ranges, then emitting writer events that produce formatted text; shipped as a CLI, NuGet/DLL and editor integration (fsautocomplete, VS Code) and used for codegen. Describes a refactor that fixes comment-preservation bugs, adds editorconfig support, gains G‑Research funding, and speeds a 4,000‑line file from 50s to 5s.
AI-written summary · about
chapters (31)
- 0:00Introduction
- 0:55Phantoms
- 4:45Abstract Syntax Tree
- 6:17Tokenizing
- 7:48Trivia
- 8:54Trivia Notes
- 10:54Debugging
- 12:57Writing instructions
- 13:53Formatting action
- 16:07How to use Phantoms
- 22:55Phantomlist
- 25:35Fsharp compiler
- 27:13Fsharp mentorship program
- 27:54Anthony Lloyd
- 30:54Phantoms release
- 31:35Meeting Don sein
- 32:34Im not alone
- 32:46Nintendo Kevin
- 33:36Debug tool
- 34:08Pull requests
- 35:32Comments in AST
- 36:39Working as a consultant
- 37:40Unexpected opportunity
- 38:29Negotiations
- 42:36Roads to Adoption
- 43:15ISharp Conference Online
- 43:32Visual Studio Plugin
- 44:12G Research Star Guides
- 45:14Benchmarks
- 45:34Closing thoughts
- 46:58Outro








