@@ -2786,7 +2786,7 @@ func isEffectiveModuleDeclaration(node *ast.Node) bool {
2786
2786
}
2787
2787
2788
2788
func getErrorRangeForArrowFunction (sourceFile * ast.SourceFile , node * ast.Node ) core.TextRange {
2789
- pos := scanner .SkipTrivia (sourceFile .Text , node .Pos ())
2789
+ pos := scanner .SkipTrivia (sourceFile .Text () , node .Pos ())
2790
2790
body := node .AsArrowFunction ().Body
2791
2791
if body != nil && body .Kind == ast .KindBlock {
2792
2792
startLine , _ := scanner .GetLineAndCharacterOfPosition (sourceFile , body .Pos ())
@@ -2804,8 +2804,8 @@ func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextR
2804
2804
errorNode := node
2805
2805
switch node .Kind {
2806
2806
case ast .KindSourceFile :
2807
- pos := scanner .SkipTrivia (sourceFile .Text , 0 )
2808
- if pos == len (sourceFile .Text ) {
2807
+ pos := scanner .SkipTrivia (sourceFile .Text () , 0 )
2808
+ if pos == len (sourceFile .Text () ) {
2809
2809
return core .NewTextRange (0 , 0 )
2810
2810
}
2811
2811
return scanner .GetRangeOfTokenAtPosition (sourceFile , pos )
@@ -2818,18 +2818,18 @@ func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextR
2818
2818
case ast .KindArrowFunction :
2819
2819
return getErrorRangeForArrowFunction (sourceFile , node )
2820
2820
case ast .KindCaseClause , ast .KindDefaultClause :
2821
- start := scanner .SkipTrivia (sourceFile .Text , node .Pos ())
2821
+ start := scanner .SkipTrivia (sourceFile .Text () , node .Pos ())
2822
2822
end := node .End ()
2823
2823
statements := node .AsCaseOrDefaultClause ().Statements .Nodes
2824
2824
if len (statements ) != 0 {
2825
2825
end = statements [0 ].Pos ()
2826
2826
}
2827
2827
return core .NewTextRange (start , end )
2828
2828
case ast .KindReturnStatement , ast .KindYieldExpression :
2829
- pos := scanner .SkipTrivia (sourceFile .Text , node .Pos ())
2829
+ pos := scanner .SkipTrivia (sourceFile .Text () , node .Pos ())
2830
2830
return scanner .GetRangeOfTokenAtPosition (sourceFile , pos )
2831
2831
case ast .KindSatisfiesExpression :
2832
- pos := scanner .SkipTrivia (sourceFile .Text , node .AsSatisfiesExpression ().Expression .End ())
2832
+ pos := scanner .SkipTrivia (sourceFile .Text () , node .AsSatisfiesExpression ().Expression .End ())
2833
2833
return scanner .GetRangeOfTokenAtPosition (sourceFile , pos )
2834
2834
case ast .KindConstructor :
2835
2835
scanner := scanner .GetScannerForSourceFile (sourceFile , node .Pos ())
@@ -2840,7 +2840,7 @@ func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextR
2840
2840
return core .NewTextRange (start , scanner .TokenEnd ())
2841
2841
// !!!
2842
2842
// case KindJSDocSatisfiesTag:
2843
- // pos := scanner.SkipTrivia(sourceFile.text , node.tagName.pos)
2843
+ // pos := scanner.SkipTrivia(sourceFile.Text() , node.tagName.pos)
2844
2844
// return scanner.GetRangeOfTokenAtPosition(sourceFile, pos)
2845
2845
}
2846
2846
if errorNode == nil {
@@ -2850,7 +2850,7 @@ func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextR
2850
2850
}
2851
2851
pos := errorNode .Pos ()
2852
2852
if ! ast .NodeIsMissing (errorNode ) {
2853
- pos = scanner .SkipTrivia (sourceFile .Text , pos )
2853
+ pos = scanner .SkipTrivia (sourceFile .Text () , pos )
2854
2854
}
2855
2855
return core .NewTextRange (pos , errorNode .End ())
2856
2856
}
0 commit comments