WriterEvent Type
Represents a single event emitted during the code formatting process. The sequence of writer events captures how the formatter produces its output.
Union cases
| Union case |
Description
|
Full Usage:
IndentBy indent
Parameters:
int
|
Increase indentation by the given number of spaces. Takes effect on the next newline.
|
|
|
|
|
Full Usage:
Placeholder
|
Placeholder separator between items in a colWithNlnWhenItemIsMultiline block. After all items are emitted, each Placeholder is inspected to determine if the item that follows it was multiline, and then replaced with the appropriate separator. No-op during WriterModel.update and dump. |
Full Usage:
RestoreAtColumn restoreAtColumn
Parameters:
int
|
Restore AtColumn to a previously saved value.
|
Full Usage:
RestoreIndent restoreIndent
Parameters:
int
|
Restore indentation to a previously saved value.
|
Full Usage:
SetAtColumn setAtColumn
Parameters:
int
|
Set the AtColumn value — the minimum indentation floor for subsequent newlines.
|
Full Usage:
SetIndent setIndent
Parameters:
int
|
Set indentation to an absolute column position.
|
Full Usage:
Start
|
Marks the beginning of a colWithNlnWhenItemIsMultiline block. No-op during WriterModel.update and dump — used only as a DLL position marker. |
Full Usage:
UnIndentBy unindent
Parameters:
int
|
Decrease indentation by the given number of spaces.
|
|
Append literal text to the current line.
|
|
Queue text to be appended just before the next newline (e.g. trailing line comments).
|
Full Usage:
WriteLine
|
End the current line and start a new one at the current indentation level. |
Full Usage:
WriteLineBecauseOfTrivia
|
Newline introduced by trivia (comments, directives) rather than by the formatter itself. Distinguished from WriteLine so colWithNlnWhenItemIsMultiline can ignore trivia-induced newlines. |
Full Usage:
WriteLineInsideStringConst
|
Newline inside a multiline string constant — no indentation is applied. |
Full Usage:
WriteLineInsideTrivia
|
Newline inside a trivia block (e.g. inside a block comment or directive). |
|
Emit text that originated from trivia (comments, XML doc lines, or compiler directives). Behaves identically to Write in dump output, but allows the formatting engine to recognise trivia events without fragile string-prefix checks (e.g. "starts with //").
|
fantomas