/// <summary> /// Writes the full text of this trivia to the specified TextWriter. /// </summary> public void WriteTo(System.IO.TextWriter writer) { UnderlyingNode?.WriteTo(writer); }
/// <summary> /// Determines if this trivia is equivalent to the specified trivia. /// </summary> public bool IsEquivalentTo(SyntaxTrivia trivia) { return ((UnderlyingNode == null && trivia.UnderlyingNode == null) || (UnderlyingNode != null && trivia.UnderlyingNode != null && UnderlyingNode.IsEquivalentTo(trivia.UnderlyingNode))); }
/// <summary> /// Returns the string representation of this trivia. If this trivia is structured trivia then the returned string /// will not include any leading or trailing trivia present on the StructuredTriviaSyntax node of this trivia. /// </summary> /// <returns>The string representation of this trivia.</returns> /// <remarks>The length of the returned string is always the same as Span.Length</remarks> public override string ToString() { return(UnderlyingNode != null?UnderlyingNode.ToString() : string.Empty); }
/// <summary> /// Returns the full string representation of this trivia. If this trivia is structured trivia then the returned string will /// include any leading or trailing trivia present on the StructuredTriviaSyntax node of this trivia. /// </summary> /// <returns>The full string representation of this trivia.</returns> /// <remarks>The length of the returned string is always the same as FullSpan.Length</remarks> public string ToFullString() { return(UnderlyingNode != null?UnderlyingNode.ToFullString() : string.Empty); }
/// <summary> /// Returns the child non-terminal node representing the syntax tree structure under this structured trivia. /// </summary> /// <returns>The child non-terminal node representing the syntax tree structure under this structured /// trivia.</returns> public SyntaxNode GetStructure() { return(HasStructure ? UnderlyingNode.GetStructure(this) : null); }
/// <summary> /// Get all the annotations of the specified annotation kinds. /// </summary> public IEnumerable <SyntaxAnnotation> GetAnnotations(params string[] annotationKinds) { return(UnderlyingNode != null ? UnderlyingNode.GetAnnotations(annotationKinds) : SpecializedCollections.EmptyEnumerable <SyntaxAnnotation>()); }
/// <summary> /// Determines whether this trivia has the specific annotation. /// </summary> public bool HasAnnotation(SyntaxAnnotation annotation) { return(UnderlyingNode?.HasAnnotation(annotation) ?? false); }
/// <summary> /// Determines where this trivia has any annotations of the specified annotation kinds. /// </summary> public bool HasAnnotations(params string[] annotationKinds) { return(UnderlyingNode?.HasAnnotations(annotationKinds) ?? false); }
/// <summary> /// Determines where this trivia has annotations of the specified annotation kind. /// </summary> public bool HasAnnotations(string annotationKind) { return(UnderlyingNode?.HasAnnotations(annotationKind) ?? false); }