-
Notifications
You must be signed in to change notification settings - Fork 4k
/
CompilationUnitSyntax.vb
30 lines (23 loc) · 1.31 KB
/
CompilationUnitSyntax.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax
Partial Public NotInheritable Class CompilationUnitSyntax
Inherits VisualBasicSyntaxNode
Implements ICompilationUnitSyntax
Private ReadOnly Property ICompilationUnitSyntax_EndOfFileToken As SyntaxToken Implements ICompilationUnitSyntax.EndOfFileToken
Get
Return EndOfFileToken
End Get
End Property
''' <summary>
''' Returns #r directives specified in the compilation.
''' </summary>
Public Function GetReferenceDirectives() As IList(Of ReferenceDirectiveTriviaSyntax)
Return GetReferenceDirectives(Nothing)
End Function
Friend Function GetReferenceDirectives(filter As Func(Of ReferenceDirectiveTriviaSyntax, Boolean)) As IList(Of ReferenceDirectiveTriviaSyntax)
' #r directives are always on the first token of the compilation unit.
Dim firstToken = CType(Me.GetFirstToken(includeZeroWidth:=True), SyntaxNodeOrToken)
Return firstToken.GetDirectives(Of ReferenceDirectiveTriviaSyntax)(filter)
End Function
End Class
End Namespace