-
Notifications
You must be signed in to change notification settings - Fork 4k
/
VisualBasicSyntaxNode_TreeTraversalHelpers.vb
25 lines (22 loc) · 1.33 KB
/
VisualBasicSyntaxNode_TreeTraversalHelpers.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
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
'-----------------------------------------------------------------------------------------------------------
' Contains syntax tree traversal methods.
'-----------------------------------------------------------------------------------------------------------
Namespace Microsoft.CodeAnalysis.VisualBasic
Partial Public Class VisualBasicSyntaxNode
''' <summary>
''' Finds a token according to the following rules:
''' 1) If position matches the End of the node's Span, then its last token is returned.
'''
''' 2) If node.FullSpan.Contains(position) then the token that contains given position is returned.
'''
''' 3) Otherwise an IndexOutOfRange is thrown
''' </summary>
Public Shadows Function FindToken(position As Integer, Optional findInsideTrivia As Boolean = False) As SyntaxToken
Return MyBase.FindToken(position, findInsideTrivia)
End Function
Public Shadows Function FindTrivia(textPosition As Integer, Optional findInsideTrivia As Boolean = False) As SyntaxTrivia
Return MyBase.FindTrivia(textPosition, findInsideTrivia)
End Function
End Class
End Namespace