Fantomas.Core Namespace
| Type/Module | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The helpers in this module are illustrated, with the events they emit and the code they produce, in src/Fantomas.Core.Tests/CodePrinterHelperFunctionsTests.fs. Read that file before this one. |
|
|
|
|
|
One set of defines the source is parsed and formatted under, such as `[ "DEBUG"; "NET" ]`. A file with conditional directives is formatted once per combination and the results merged, see `MultipleDefineCombinations`. |
|
|
Raised when one or more conditional compilation define combinations produce invalid syntax trees. |
|
|
|
|
|
|
|
|
Mutable doubly-linked list of WriterEvents. Supports O(1) append, insert, remove, and truncation. |
|
|
A node in the mutable doubly-linked list of WriterEvents.
We use [ |
|
|
|
|
|
Raised when Fantomas encounters a problem during formatting. |
|
|
|
|
|
Raised when Fantomas reaches a state that its own model says is impossible, for example a chain whose parts do not fit the shape the transformer guarantees. Unlike the other exceptions here, this never indicates a problem with the code being formatted: it is a bug in Fantomas, or a change in how the F# parser groups expressions. Failing loudly is deliberate — the alternative is silently dropping parts of the source. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Raised when the F# parser produces errors for source code without conditional directives. |
|
|
|
|
|
append only collection optimized for quick append of block of data and query operations data - list of blocks in reverse order |
|
|
|
|
|
Split the range of a node into the ranges of the tokens that delimit it, so the transformer can give an opening or closing token a `SingleTextNode` of its own. `size` is the length of the token in characters: 1 for `(`, 2 for `[|` or `{|`. The ranges are computed from the ends of the node's range, not looked up, so they are only right when the token really is the first or last thing in the node. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
What Fantomas made of a piece of F# source when it was asked whether that source is valid. The verdict and the reason for it together, because a caller that has to tell somebody why cannot reconstruct it from a boolean, and asking twice would parse the source twice. |
|
|
|
|
|
Represents a single event emitted during the code formatting process. The sequence of writer events captures how the formatter produces its output. |
fantomas