@@ -1256,8 +1256,10 @@ namespace ts {
12561256 * Finds the rightmost token satisfying `token.end <= position`,
12571257 * excluding `JsxText` tokens containing only whitespace.
12581258 */
1259- export function findPrecedingToken ( position : number , sourceFile : SourceFile , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined {
1260- const result = find ( startNode || sourceFile ) ;
1259+ export function findPrecedingToken ( position : number , sourceFile : SourceFileLike , startNode : Node , excludeJsdoc ?: boolean ) : Node | undefined ;
1260+ export function findPrecedingToken ( position : number , sourceFile : SourceFile , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined ;
1261+ export function findPrecedingToken ( position : number , sourceFile : SourceFileLike , startNode ?: Node , excludeJsdoc ?: boolean ) : Node | undefined {
1262+ const result = find ( ( startNode || sourceFile ) as Node ) ;
12611263 Debug . assert ( ! ( result && isWhiteSpaceOnlyJsxText ( result ) ) ) ;
12621264 return result ;
12631265
@@ -1322,7 +1324,7 @@ namespace ts {
13221324 return isToken ( n ) && ! isWhiteSpaceOnlyJsxText ( n ) ;
13231325 }
13241326
1325- function findRightmostToken ( n : Node , sourceFile : SourceFile ) : Node | undefined {
1327+ function findRightmostToken ( n : Node , sourceFile : SourceFileLike ) : Node | undefined {
13261328 if ( isNonWhitespaceToken ( n ) ) {
13271329 return n ;
13281330 }
@@ -1339,7 +1341,7 @@ namespace ts {
13391341 /**
13401342 * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens.
13411343 */
1342- function findRightmostChildNodeWithTokens ( children : Node [ ] , exclusiveStartPosition : number , sourceFile : SourceFile , parentKind : SyntaxKind ) : Node | undefined {
1344+ function findRightmostChildNodeWithTokens ( children : Node [ ] , exclusiveStartPosition : number , sourceFile : SourceFileLike , parentKind : SyntaxKind ) : Node | undefined {
13431345 for ( let i = exclusiveStartPosition - 1 ; i >= 0 ; i -- ) {
13441346 const child = children [ i ] ;
13451347
0 commit comments