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

Function findRightmostToken

test/fixtures/snapshot/typescript.js:127612–127622  ·  view source on GitHub ↗
(n, sourceFile)

Source from the content-addressed store, hash-verified

127610 return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n);
127611 }
127612 function findRightmostToken(n, sourceFile) {
127613 if (isNonWhitespaceToken(n)) {
127614 return n;
127615 }
127616 var children = n.getChildren(sourceFile);
127617 if (children.length === 0) {
127618 return n;
127619 }
127620 var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile, n.kind);
127621 return candidate && findRightmostToken(candidate, sourceFile);
127622 }
127623 /**
127624 * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens.
127625 */

Callers 1

findFunction · 0.85

Calls 3

isNonWhitespaceTokenFunction · 0.85
getChildrenMethod · 0.80

Tested by

no test coverage detected