( source: SourceFileLocation, options?: Pick<MdReportOptions, 'outputDir'>, )
| 101 | * linkToLocalSourceInIde({ file: 'src/index.ts' }, { outputDir: '.code-pushup' }) // [`src/index.ts`](../src/index.ts) |
| 102 | */ |
| 103 | export function linkToLocalSourceForIde( |
| 104 | source: SourceFileLocation, |
| 105 | options?: Pick<MdReportOptions, 'outputDir'>, |
| 106 | ): InlineText { |
| 107 | const { file, position } = source; |
| 108 | const { outputDir } = options ?? {}; |
| 109 | |
| 110 | // NOT linkable |
| 111 | if (!outputDir) { |
| 112 | return md.code(file); |
| 113 | } |
| 114 | |
| 115 | return md.link(formatFileLink(file, position, outputDir), md.code(file)); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Link to source (handles both file and URL sources) |
no test coverage detected