Skip to content

Commit fc5909a

Browse files
authored
Remove extra sourceFile for findRightmostNode (microsoft#499)
1 parent fea1656 commit fc5909a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/astnav/tokens.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func getTokenAtPosition(
127127
// Check if the rightmost token of prevSubtree should be returned based on the
128128
// `includePrecedingTokenAtEndPosition` callback.
129129
if prevSubtree != nil {
130-
child := findRightmostNode(prevSubtree, sourceFile)
130+
child := findRightmostNode(prevSubtree)
131131
if child.End() == position && includePrecedingTokenAtEndPosition(child) {
132132
// Optimization: includePrecedingTokenAtEndPosition only ever returns true
133133
// for real AST nodes, so we don't run the scanner here.
@@ -182,7 +182,7 @@ func getPosition(node *ast.Node, sourceFile *ast.SourceFile, allowPositionInLead
182182
return scanner.GetTokenPosOfNode(node, sourceFile, true /*includeJsDoc*/)
183183
}
184184

185-
func findRightmostNode(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node {
185+
func findRightmostNode(node *ast.Node) *ast.Node {
186186
var next *ast.Node
187187
current := node
188188
visitNode := func(node *ast.Node, _ *ast.NodeVisitor) *ast.Node {

0 commit comments

Comments
 (0)