(node)
| 160508 | return { start: start, length: end - start }; |
| 160509 | } |
| 160510 | function getStatementOrExpressionRange(node) { |
| 160511 | if (ts.isStatement(node)) { |
| 160512 | return [node]; |
| 160513 | } |
| 160514 | if (ts.isExpressionNode(node)) { |
| 160515 | // If our selection is the expression in an ExpressionStatement, expand |
| 160516 | // the selection to include the enclosing Statement (this stops us |
| 160517 | // from trying to care about the return value of the extracted function |
| 160518 | // and eliminates double semicolon insertion in certain scenarios) |
| 160519 | return ts.isExpressionStatement(node.parent) ? [node.parent] : node; |
| 160520 | } |
| 160521 | if (isStringLiteralJsxAttribute(node)) { |
| 160522 | return node; |
| 160523 | } |
| 160524 | return undefined; |
| 160525 | } |
| 160526 | function isScope(node) { |
| 160527 | return ts.isArrowFunction(node) ? ts.isFunctionBody(node.body) : |
| 160528 | ts.isFunctionLikeDeclaration(node) || ts.isSourceFile(node) || ts.isModuleBlock(node) || ts.isClassLike(node); |
no test coverage detected