@@ -24,7 +24,7 @@ func deleteDeclaration(t *Tracker, deletedNodesInLists map[*ast.Node]bool, sourc
2424 // Lambdas with exactly one parameter are special because, after removal, there
2525 // must be an empty parameter list (i.e. `()`) and this won't necessarily be the
2626 // case if the parameter is simply removed (e.g. in `x => 1`).
27- t .ReplaceRangeWithText (sourceFile , t .GetAdjustedRange (sourceFile , node , node , LeadingTriviaOptionIncludeAll , TrailingTriviaOptionInclude ), "()" )
27+ t .ReplaceTextRangeWithText (sourceFile , t .GetAdjustedRange (sourceFile , node , node , LeadingTriviaOptionIncludeAll , TrailingTriviaOptionInclude ), "()" )
2828 } else {
2929 deleteNodeInList (t , deletedNodesInLists , sourceFile , node )
3030 }
@@ -114,7 +114,7 @@ func deleteDefaultImport(t *Tracker, sourceFile *ast.SourceFile, importClause *a
114114 if nextToken != nil && nextToken .Kind == ast .KindCommaToken {
115115 // shift first non-whitespace position after comma to the start position of the node
116116 end := scanner .SkipTriviaEx (sourceFile .Text (), nextToken .End (), & scanner.SkipTriviaOptions {StopAfterLineBreak : false , StopAtComments : true })
117- t .ReplaceRangeWithText (sourceFile , t . toLSPEditRange ( sourceFile , core .NewTextRange (start , end ) ), "" )
117+ t .ReplaceTextRangeWithText (sourceFile , core .NewTextRange (start , end ), "" )
118118 } else {
119119 deleteNode (t , sourceFile , name , LeadingTriviaOptionIncludeAll , TrailingTriviaOptionInclude )
120120 }
@@ -130,7 +130,7 @@ func deleteImportBinding(t *Tracker, sourceFile *ast.SourceFile, node *ast.Node)
130130 previousToken := astnav .GetTokenAtPosition (sourceFile , node .Pos ()- 1 )
131131 debug .Assert (previousToken != nil , "previousToken should not be nil" )
132132 start := astnav .GetStartOfNode (previousToken , sourceFile , false )
133- t .ReplaceRangeWithText (sourceFile , t . toLSPEditRange ( sourceFile , core .NewTextRange (start , node .End () )), "" )
133+ t .ReplaceTextRangeWithText (sourceFile , core .NewTextRange (start , node .End ()), "" )
134134 } else {
135135 // Delete the entire import declaration
136136 // |import * as ns from './file'|
@@ -183,7 +183,7 @@ func deleteVariableDeclaration(t *Tracker, deletedNodesInLists map[*ast.Node]boo
183183func deleteNode (t * Tracker , sourceFile * ast.SourceFile , node * ast.Node , leadingTrivia LeadingTriviaOption , trailingTrivia TrailingTriviaOption ) {
184184 startPosition := t .getAdjustedStartPosition (sourceFile , node , leadingTrivia , false )
185185 endPosition := t .getAdjustedEndPosition (sourceFile , node , trailingTrivia )
186- t .ReplaceRangeWithText (sourceFile , t . toLSPEditRange ( sourceFile , core .NewTextRange (startPosition , endPosition ) ), "" )
186+ t .ReplaceTextRangeWithText (sourceFile , core .NewTextRange (startPosition , endPosition ), "" )
187187}
188188
189189func deleteNodeInList (t * Tracker , deletedNodesInLists map [* ast.Node ]bool , sourceFile * ast.SourceFile , node * ast.Node ) {
@@ -214,7 +214,7 @@ func deleteNodeInList(t *Tracker, deletedNodesInLists map[*ast.Node]bool, source
214214 endPos = t .endPositionToDeleteNodeInList (sourceFile , node , prevNode , containingList .Nodes [index + 1 ])
215215 }
216216
217- t .ReplaceRangeWithText (sourceFile , t . toLSPEditRange ( sourceFile , core .NewTextRange (startPos , endPos ) ), "" )
217+ t .ReplaceTextRangeWithText (sourceFile , core .NewTextRange (startPos , endPos ), "" )
218218}
219219
220220// startPositionToDeleteNodeInList finds the first non-whitespace position in the leading trivia of the node
0 commit comments