Skip to main content

SyntaxExtensions.GetFirstDirective(SyntaxNode, TextSpan, Func<DirectiveTriviaSyntax, Boolean>) Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Gets the first directive of the tree rooted by this node.

public static Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax? GetFirstDirective(this Microsoft.CodeAnalysis.SyntaxNode node, Microsoft.CodeAnalysis.Text.TextSpan span, Func<Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax, bool>? predicate = null)

Parameters

node SyntaxNode

span TextSpan

predicate Func<DirectiveTriviaSyntax, Boolean>

Returns

DirectiveTriviaSyntax