/// <summary> /// True if this token has the specified annotation. /// </summary> public bool HasAnnotation(SyntaxAnnotation annotation) { return(Node?.HasAnnotation(annotation) ?? false); }
/// <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))); }
/// <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())); }
/// <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))); }
/// <summary> /// Determines whether this node has the specific annotation. /// </summary> public bool HasAnnotation(SyntaxAnnotation annotation) { return(this.Green.HasAnnotation(annotation)); }
/// <summary> /// Determines whether this trivia has the specific annotation. /// </summary> public bool HasAnnotation(SyntaxAnnotation annotation) { return(_triviaNode != null && _triviaNode.HasAnnotation(annotation)); }