( callExpression: ts.CallExpression )
| 14 | } from "./ts.ts" |
| 15 | |
| 16 | export const getCallLocationFromCallExpression = ( |
| 17 | callExpression: ts.CallExpression |
| 18 | ): LinePositionRange => { |
| 19 | const start = ts.getLineAndCharacterOfPosition( |
| 20 | callExpression.getSourceFile(), |
| 21 | callExpression.getStart() |
| 22 | ) |
| 23 | const end = ts.getLineAndCharacterOfPosition( |
| 24 | callExpression.getSourceFile(), |
| 25 | callExpression.getEnd() |
| 26 | ) |
| 27 | // Add 1 to everything, since trace positions are 1-based and TS positions are 0-based. |
| 28 | const location: LinePositionRange = { |
| 29 | start: { |
| 30 | line: start.line + 1, |
| 31 | char: start.character + 1 |
| 32 | }, |
| 33 | end: { |
| 34 | line: end.line + 1, |
| 35 | char: end.character + 1 |
| 36 | } |
| 37 | } |
| 38 | return location |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Processes inline instantiations from an attest call |
no outgoing calls
no test coverage detected