Skip to main content

SyntaxToken Struct Extensions

Extension MethodSummary
AppendToLeadingTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>)Creates a new token from this token with the leading trivia replaced with a new trivia where the specified trivia is added at the end of the leading trivia.
AppendToLeadingTrivia(SyntaxToken, SyntaxTrivia)Creates a new token from this token with the leading trivia replaced with a new trivia where the specified trivia is added at the end of the leading trivia.
AppendToTrailingTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>)Creates a new token from this token with the trailing trivia replaced with a new trivia where the specified trivia is added at the end of the trailing trivia.
AppendToTrailingTrivia(SyntaxToken, SyntaxTrivia)Creates a new token from this token with the trailing trivia replaced with a new trivia where the specified trivia is added at the end of the trailing trivia.
IsKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token's kind is one of the specified kinds.
IsKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token's kind is one of the specified kinds.
IsKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token's kind is one of the specified kinds.
IsKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token's kind is one of the specified kinds.
IsKind(SyntaxToken, SyntaxKind, SyntaxKind)Returns true if a token's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token parent's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token parent's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token parent's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind, SyntaxKind, SyntaxKind)Returns true if a token parent's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind, SyntaxKind)Returns true if a token parent's kind is one of the specified kinds.
IsParentKind(SyntaxToken, SyntaxKind)Returns true if a token parent's kind is the specified kind.
LeadingAndTrailingTrivia(SyntaxToken)Returns leading and trailing trivia of the specified node in a single list.
PrependToLeadingTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>)Creates a new token from this token with the leading trivia replaced with a new trivia where the specified trivia is inserted at the beginning of the leading trivia.
PrependToLeadingTrivia(SyntaxToken, SyntaxTrivia)Creates a new token from this token with the leading trivia replaced with a new trivia where the specified trivia is inserted at the beginning of the leading trivia.
PrependToTrailingTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>)Creates a new token from this token with the trailing trivia replaced with a new trivia where the specified trivia is inserted at the beginning of the trailing trivia.
PrependToTrailingTrivia(SyntaxToken, SyntaxTrivia)Creates a new token from this token with the trailing trivia replaced with a new trivia where the specified trivia is inserted at the beginning of the trailing trivia.
TrimLeadingTrivia(SyntaxToken)Removes all leading whitespace from the leading trivia and returns a new token with the new leading trivia. SyntaxKind.WhitespaceTrivia and SyntaxKind.EndOfLineTrivia is considered to be a whitespace. Returns the same token if there is nothing to trim.
TrimTrailingTrivia(SyntaxToken)Removes all trailing whitespace from the trailing trivia and returns a new token with the new trailing trivia. SyntaxKind.WhitespaceTrivia and SyntaxKind.EndOfLineTrivia is considered to be a whitespace. Returns the same token if there is nothing to trim.
TrimTrivia(SyntaxToken)Removes all leading whitespace from the leading trivia and all trailing whitespace from the trailing trivia and returns a new token with the new trivia. SyntaxKind.WhitespaceTrivia and SyntaxKind.EndOfLineTrivia is considered to be a whitespace. Returns the same token if there is nothing to trim.
WithFormatterAnnotation(SyntaxToken)Adds Formatter.Annotation to the specified token, creating a new token of the same type with the Formatter.Annotation on it.
WithNavigationAnnotation(SyntaxToken)Adds navigation annotation to the specified token, creating a new token of the same type with the navigation annotation on it. Navigation annotation allows to mark a token that should be selected after the code action is applied.
WithoutLeadingTrivia(SyntaxToken)Creates a new token from this token with the leading trivia removed.
WithoutTrailingTrivia(SyntaxToken)Creates a new token from this token with the trailing trivia removed.
WithRenameAnnotation(SyntaxToken)Adds "rename" annotation to the specified token, creating a new token of the same type with the "rename" annotation on it. "Rename" annotation is specified by RenameAnnotation.Kind.
WithSimplifierAnnotation(SyntaxToken)Adds Simplifier.Annotation to the specified token, creating a new token of the same type with the Simplifier.Annotation on it. "Rename" annotation is specified by RenameAnnotation.Kind.
WithTriviaFrom(SyntaxToken, SyntaxNode)Creates a new token from this token with both the leading and trailing trivia of the specified node.