Example #1
0
 /// <summary>
 /// True if this token has the specified annotation.
 /// </summary>
 public bool HasAnnotation(SyntaxAnnotation annotation)
 {
     return(Node?.HasAnnotation(annotation) ?? false);
 }
Example #2
0
 /// <summary>
 /// Gets all trivia with the specified annotation.
 /// </summary>
 public IEnumerable <SyntaxTrivia> GetAnnotatedTrivia(SyntaxAnnotation annotation)
 {
     return(this.DescendantTrivia(n => n.ContainsAnnotations, descendIntoTrivia: true)
            .Where(tr => tr.HasAnnotation(annotation)));
 }
Example #3
0
 /// <summary>
 /// Gets all tokens with the specified annotation.
 /// </summary>
 public IEnumerable <SyntaxToken> GetAnnotatedTokens(SyntaxAnnotation syntaxAnnotation)
 {
     return(this.GetAnnotatedNodesAndTokens(syntaxAnnotation).Where(n => n.IsToken).Select(n => n.AsToken()));
 }
Example #4
0
 /// <summary>
 /// Gets all nodes and tokens with the specified annotation.
 /// </summary>
 public IEnumerable <SyntaxNodeOrToken> GetAnnotatedNodesAndTokens(SyntaxAnnotation annotation)
 {
     return(this.DescendantNodesAndTokensAndSelf(n => n.ContainsAnnotations, descendIntoTrivia: true)
            .Where(t => t.HasAnnotation(annotation)));
 }
Example #5
0
 /// <summary>
 /// Determines whether this node has the specific annotation.
 /// </summary>
 public bool HasAnnotation(SyntaxAnnotation annotation)
 {
     return(this.Green.HasAnnotation(annotation));
 }
Example #6
0
 /// <summary>
 /// Determines whether this trivia has the specific annotation.
 /// </summary>
 public bool HasAnnotation(SyntaxAnnotation annotation)
 {
     return(_triviaNode != null && _triviaNode.HasAnnotation(annotation));
 }