trailingTrivia

The trailing trivia of this syntax node.

SyntaxProtocol.swift:517
var trailingTrivia: Trivia { get set }

Trivia is always attached to tokens, not to layout nodes. This will return the trailing trivia of the last token within the subtree. If no such token exists, this returns empty trivia.

Note: Trivia is not able to represent invalid UTF-8 sequences. To get the leading trivia text including all invalid UTF-8 sequences, use

node.syntaxTextBytes[(node.byteSize - node.trailingTriviaLength.utf8Length)...]