( ref: Reference<ClassDeclaration>, rawExpr: ts.Expression | null, )
| 15 | import {ComponentScopeKind, ComponentScopeReader} from './api'; |
| 16 | |
| 17 | export function getDiagnosticNode( |
| 18 | ref: Reference<ClassDeclaration>, |
| 19 | rawExpr: ts.Expression | null, |
| 20 | ): ts.Expression { |
| 21 | // Show the diagnostic on the node within `rawExpr` which references the declaration |
| 22 | // in question. `rawExpr` represents the raw expression from which `ref` was partially evaluated, |
| 23 | // so use that to find the right node. Note that by the type system, `rawExpr` might be `null`, so |
| 24 | // fall back on the declaration identifier in that case (even though in practice this should never |
| 25 | // happen since local NgModules always have associated expressions). |
| 26 | return rawExpr !== null ? ref.getOriginForDiagnostics(rawExpr) : ref.node.name; |
| 27 | } |
| 28 | |
| 29 | export function makeNotStandaloneDiagnostic( |
| 30 | scopeReader: ComponentScopeReader, |
no test coverage detected