* Returns true if node should be treated as classified and no further processing is required. * False will mean that node is not classified and traverse routine should recurse into node contents.
(node)
| 130781 | * False will mean that node is not classified and traverse routine should recurse into node contents. |
| 130782 | */ |
| 130783 | function tryClassifyNode(node) { |
| 130784 | if (ts.isJSDoc(node)) { |
| 130785 | return true; |
| 130786 | } |
| 130787 | if (ts.nodeIsMissing(node)) { |
| 130788 | return true; |
| 130789 | } |
| 130790 | var classifiedElementName = tryClassifyJsxElementName(node); |
| 130791 | if (!ts.isToken(node) && node.kind !== 11 /* SyntaxKind.JsxText */ && classifiedElementName === undefined) { |
| 130792 | return false; |
| 130793 | } |
| 130794 | var tokenStart = node.kind === 11 /* SyntaxKind.JsxText */ ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); |
| 130795 | var tokenWidth = node.end - tokenStart; |
| 130796 | ts.Debug.assert(tokenWidth >= 0); |
| 130797 | if (tokenWidth > 0) { |
| 130798 | var type = classifiedElementName || classifyTokenType(node.kind, node); |
| 130799 | if (type) { |
| 130800 | pushClassification(tokenStart, tokenWidth, type); |
| 130801 | } |
| 130802 | } |
| 130803 | return true; |
| 130804 | } |
| 130805 | function tryClassifyJsxElementName(token) { |
| 130806 | switch (token.parent && token.parent.kind) { |
| 130807 | case 280 /* SyntaxKind.JsxOpeningElement */: |
no test coverage detected