Skip to content

Commit 7fb6c99

Browse files
Don't create an unnecessary text span in isInStringOrRegularExpressionOrTemplateLiteral (#52697)
1 parent bd905d4 commit 7fb6c99

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/services/completions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
createPackageJsonImportFilter,
3737
createPrinter,
3838
createSortedArray,
39-
createTextRangeFromSpan,
4039
createTextSpanFromBounds,
4140
createTextSpanFromNode,
4241
createTextSpanFromRange,
@@ -3697,7 +3696,7 @@ function getCompletionData(
36973696
// 2. at the end position of an unterminated token.
36983697
// 3. at the end of a regular expression (due to trailing flags like '/foo/g').
36993698
return (isRegularExpressionLiteral(contextToken) || isStringTextContainingNode(contextToken)) && (
3700-
rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken)), position) ||
3699+
rangeContainsPositionExclusive(contextToken, position) ||
37013700
position === contextToken.end && (!!contextToken.isUnterminated || isRegularExpressionLiteral(contextToken)));
37023701
}
37033702

0 commit comments

Comments
 (0)