Logo fantomas

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

IndentBy indent

Full Usage: IndentBy indent

Parameters:
    indent : int

Increase indentation by the given number of spaces. Takes effect on the next newline.

indent : int

NodeEnd(endNodeType, endRange)

Full Usage: NodeEnd(endNodeType, endRange)

Parameters:
    endNodeType : string
    endRange : string

Diagnostic marker: end of an Oak node. Only emitted when DebugMode is enabled.

endNodeType : string
endRange : string

NodeStart(nodeType, range)

Full Usage: NodeStart(nodeType, range)

Parameters:
    nodeType : string
    range : string

Diagnostic marker: beginning of an Oak node. Only emitted when DebugMode is enabled.

nodeType : string
range : string

Placeholder

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.

RestoreAtColumn restoreAtColumn

Full Usage: RestoreAtColumn restoreAtColumn

Parameters:
    restoreAtColumn : int

Restore AtColumn to a previously saved value.

restoreAtColumn : int

RestoreIndent restoreIndent

Full Usage: RestoreIndent restoreIndent

Parameters:
    restoreIndent : int

Restore indentation to a previously saved value.

restoreIndent : int

SetAtColumn setAtColumn

Full Usage: SetAtColumn setAtColumn

Parameters:
    setAtColumn : int

Set the AtColumn value — the minimum indentation floor for subsequent newlines.

setAtColumn : int

SetIndent setIndent

Full Usage: SetIndent setIndent

Parameters:
    setIndent : int

Set indentation to an absolute column position.

setIndent : int

Start

Full Usage: Start

Marks the beginning of a colWithNlnWhenItemIsMultiline block. No-op during WriterModel.update and dump — used only as a DLL position marker.

UnIndentBy unindent

Full Usage: UnIndentBy unindent

Parameters:
    unindent : int

Decrease indentation by the given number of spaces.

unindent : int

Write text

Full Usage: Write text

Parameters:
    text : string

Append literal text to the current line.

text : string

WriteBeforeNewline content

Full Usage: WriteBeforeNewline content

Parameters:
    content : string

Queue text to be appended just before the next newline (e.g. trailing line comments).

content : string

WriteLine

Full Usage: WriteLine

End the current line and start a new one at the current indentation level.

WriteLineBecauseOfTrivia

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.

WriteLineInsideStringConst

Full Usage: WriteLineInsideStringConst

Newline inside a multiline string constant — no indentation is applied.

WriteLineInsideTrivia

Full Usage: WriteLineInsideTrivia

Newline inside a trivia block (e.g. inside a block comment or directive).

WriteTrivia trivia

Full Usage: WriteTrivia trivia

Parameters:
    trivia : string

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 //").

trivia : string

Instance members

Instance member Description

this.IsIndentBy

Full Usage: this.IsIndentBy

Returns: bool
Returns: bool

this.IsNodeEnd

Full Usage: this.IsNodeEnd

Returns: bool
Returns: bool

this.IsNodeStart

Full Usage: this.IsNodeStart

Returns: bool
Returns: bool

this.IsPlaceholder

Full Usage: this.IsPlaceholder

Returns: bool
Returns: bool

this.IsRestoreAtColumn

Full Usage: this.IsRestoreAtColumn

Returns: bool
Returns: bool

this.IsRestoreIndent

Full Usage: this.IsRestoreIndent

Returns: bool
Returns: bool

this.IsSetAtColumn

Full Usage: this.IsSetAtColumn

Returns: bool
Returns: bool

this.IsSetIndent

Full Usage: this.IsSetIndent

Returns: bool
Returns: bool

this.IsStart

Full Usage: this.IsStart

Returns: bool
Returns: bool

this.IsUnIndentBy

Full Usage: this.IsUnIndentBy

Returns: bool
Returns: bool

this.IsWrite

Full Usage: this.IsWrite

Returns: bool
Returns: bool

this.IsWriteBeforeNewline

Full Usage: this.IsWriteBeforeNewline

Returns: bool
Returns: bool

this.IsWriteLine

Full Usage: this.IsWriteLine

Returns: bool
Returns: bool

this.IsWriteLineBecauseOfTrivia

Full Usage: this.IsWriteLineBecauseOfTrivia

Returns: bool
Returns: bool

this.IsWriteLineInsideStringConst

Full Usage: this.IsWriteLineInsideStringConst

Returns: bool
Returns: bool

this.IsWriteLineInsideTrivia

Full Usage: this.IsWriteLineInsideTrivia

Returns: bool
Returns: bool

this.IsWriteTrivia

Full Usage: this.IsWriteTrivia

Returns: bool
Returns: bool

Type something to start searching.