(fileName: string, position: number)
| 458 | } |
| 459 | |
| 460 | async getFunctionAST(fileName: string, position: number): Promise<DumpFunctionResponseBody> { |
| 461 | const openedFile = this.getOpenedFile(fileName); |
| 462 | const node = findNode(openedFile.sourceFile, position, (node) => ts.isFunctionDeclaration(node)); |
| 463 | if (!node) { |
| 464 | throw new Error(`Could not resolve function declaration at position ${position}`); |
| 465 | } |
| 466 | |
| 467 | const references: AST.TypeReference[] = []; |
| 468 | |
| 469 | const dumpedFunction = dumpFunction(node as ts.FunctionDeclaration, { |
| 470 | typeChecker: openedFile.workspaceProject.typeChecker, |
| 471 | references, |
| 472 | }); |
| 473 | |
| 474 | return { |
| 475 | function: dumpedFunction, |
| 476 | references, |
| 477 | }; |
| 478 | } |
| 479 | |
| 480 | async getEnumAST(fileName: string, position: number): Promise<DumpEnumResponseBody> { |
| 481 | const openedFile = this.getOpenedFile(fileName); |
nothing calls this directly
no test coverage detected