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

comment : string
newlineBefore : bool
newlineAfter : bool

CommentOnSingleLine string

Full Usage: CommentOnSingleLine string

Parameters:
    Item : string

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

Item : string

LineCommentAfterSourceCode comment

Full Usage: LineCommentAfterSourceCode comment

Parameters:
    comment : string

comment : string

Newline

Full Usage: Newline

Instance members

Instance member Description

this.IsBlockComment

Full Usage: this.IsBlockComment

Returns: bool
Returns: bool

this.IsCommentOnSingleLine

Full Usage: this.IsCommentOnSingleLine

Returns: bool
Returns: bool

this.IsCommentOnSingleLineWithLeadingNewlines

Full Usage: this.IsCommentOnSingleLineWithLeadingNewlines

Returns: bool
Returns: bool

this.IsCursor

Full Usage: this.IsCursor

Returns: bool
Returns: bool

this.IsDirective

Full Usage: this.IsDirective

Returns: bool
Returns: bool

this.IsLineCommentAfterSourceCode

Full Usage: this.IsLineCommentAfterSourceCode

Returns: bool
Returns: bool

this.IsNewline

Full Usage: this.IsNewline

Returns: bool
Returns: bool

Type something to start searching.