Logo fantomas

TriviaContent Type

The kind of non-code content that can be attached to a node as trivia. Single-line and line-after-source-code comments carry their text; block comments also record whether blank lines should surround them. Directive covers preprocessor directives and Cursor is used by editor tooling to track the caret position during formatting.

Union cases

Union case Description

BlockComment(comment, newlineBefore, newlineAfter)

Full Usage: BlockComment(comment, newlineBefore, newlineAfter)

Parameters:
comment : string
newlineBefore : bool
newlineAfter : bool

CommentOnSingleLine string

Full Usage: CommentOnSingleLine string

Parameters:
Item : string

CommentOnSingleLineWithLeadingNewlines(newlines, comment)

Full Usage: CommentOnSingleLineWithLeadingNewlines(newlines, comment)

Parameters:
    newlines : int
    comment : string

A single-line comment preceded by one or more blank lines in the source. Unlike a plain CommentOnSingleLine + separate Newline trivia, this combined case ensures the blank lines and comment are assigned to the same Oak node during trivia assignment. Without this, the Newline (at column 0) and the indented comment (at column > 0) would be assigned to different nodes via different matching paths, causing the blank line to be lost or misplaced after formatting.

newlines : int
comment : string

Cursor

Full Usage: Cursor

Directive string

Full Usage: Directive string

Parameters:
Item : string

LineCommentAfterSourceCode comment

Full Usage: LineCommentAfterSourceCode comment

Parameters:
comment : string

Newline

Full Usage: Newline

Type something to start searching.