( result: CallHierarchyItem[] | null, cwd?: string, )
| 453 | * Returns the call hierarchy item(s) at the given position |
| 454 | */ |
| 455 | export function formatPrepareCallHierarchyResult( |
| 456 | result: CallHierarchyItem[] | null, |
| 457 | cwd?: string, |
| 458 | ): string { |
| 459 | if (!result || result.length === 0) { |
| 460 | return 'No call hierarchy item found at this position' |
| 461 | } |
| 462 | |
| 463 | if (result.length === 1) { |
| 464 | return `Call hierarchy item: ${formatCallHierarchyItem(result[0]!, cwd)}` |
| 465 | } |
| 466 | |
| 467 | const lines = [`Found ${result.length} call hierarchy items:`] |
| 468 | for (const item of result) { |
| 469 | lines.push(` ${formatCallHierarchyItem(item, cwd)}`) |
| 470 | } |
| 471 | return lines.join('\n') |
| 472 | } |
| 473 | |
| 474 | /** |
| 475 | * Formats incomingCalls result |
no test coverage detected