(node: TmplAstNode | AST)
| 46 | import {findTightestNode, getParentClassDeclaration} from './ts_utils'; |
| 47 | |
| 48 | export function getTextSpanOfNode(node: TmplAstNode | AST): ts.TextSpan { |
| 49 | if (isTemplateNodeWithKeyAndValue(node)) { |
| 50 | return toTextSpan(node.keySpan); |
| 51 | } else if (node instanceof BindingPipe || node instanceof PropertyRead) { |
| 52 | // The `name` part of a `PropertyRead` and `BindingPipe` does not have its own AST |
| 53 | // so there is no way to retrieve a `Symbol` for just the `name` via a specific node. |
| 54 | return toTextSpan(node.nameSpan); |
| 55 | } else { |
| 56 | return toTextSpan(node.sourceSpan); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export function toTextSpan(span: AbsoluteSourceSpan | ParseSourceSpan | ParseSpan): ts.TextSpan { |
| 61 | let start: number, end: number; |
no test coverage detected