MCPcopy Create free account
hub / github.com/nodejs/node / findFirstNonJsxWhitespaceToken

Function findFirstNonJsxWhitespaceToken

test/fixtures/snapshot/typescript.js:127506–127515  ·  view source on GitHub ↗

* Returns the first token where position is in [start, end), * excluding `JsxText` tokens containing only whitespace.

(sourceFile, position)

Source from the content-addressed store, hash-verified

127504 * excluding `JsxText` tokens containing only whitespace.
127505 */
127506 function findFirstNonJsxWhitespaceToken(sourceFile, position) {
127507 var tokenAtPosition = getTokenAtPosition(sourceFile, position);
127508 while (isWhiteSpaceOnlyJsxText(tokenAtPosition)) {
127509 var nextToken = findNextToken(tokenAtPosition, tokenAtPosition.parent, sourceFile);
127510 if (!nextToken)
127511 return;
127512 tokenAtPosition = nextToken;
127513 }
127514 return tokenAtPosition;
127515 }
127516 ts.findFirstNonJsxWhitespaceToken = findFirstNonJsxWhitespaceToken;
127517 /**
127518 * The token on the left of the position is the token that strictly includes the position

Callers

nothing calls this directly

Calls 3

getTokenAtPositionFunction · 0.85
isWhiteSpaceOnlyJsxTextFunction · 0.85
findNextTokenFunction · 0.85

Tested by

no test coverage detected