MCPcopy
hub / github.com/codeaashu/claude-code / formatPrepareCallHierarchyResult

Function formatPrepareCallHierarchyResult

src/tools/LSPTool/formatters.ts:455–472  ·  view source on GitHub ↗
(
  result: CallHierarchyItem[] | null,
  cwd?: string,
)

Source from the content-addressed store, hash-verified

453 * Returns the call hierarchy item(s) at the given position
454 */
455export 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

Callers 1

formatResultFunction · 0.85

Calls 2

formatCallHierarchyItemFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected