(
result: Extract<ToolDomainResult, { kind: 'scheme-list' }>,
)
| 911 | } |
| 912 | |
| 913 | function createSchemeListItems( |
| 914 | result: Extract<ToolDomainResult, { kind: 'scheme-list' }>, |
| 915 | ): TextRenderableItem[] { |
| 916 | const [label, pathValue] = |
| 917 | 'projectPath' in result.artifacts |
| 918 | ? (['Project', result.artifacts.projectPath] as const) |
| 919 | : (['Workspace', result.artifacts.workspacePath] as const); |
| 920 | const items: TextRenderableItem[] = [ |
| 921 | createHeader('List Schemes', [{ label, value: displayPath(pathValue) }]), |
| 922 | ]; |
| 923 | if (result.didError) { |
| 924 | items.push(...createFailureStatusWithDiagnostics(result, 'Failed to list schemes.')); |
| 925 | return items; |
| 926 | } |
| 927 | |
| 928 | items.push( |
| 929 | createStatus( |
| 930 | 'success', |
| 931 | `Found ${result.schemes.length} ${result.schemes.length === 1 ? 'scheme' : 'schemes'}`, |
| 932 | ), |
| 933 | ); |
| 934 | items.push(createSection('Schemes:', result.schemes)); |
| 935 | return items; |
| 936 | } |
| 937 | |
| 938 | function createBuildSettingsItems( |
| 939 | result: Extract<ToolDomainResult, { kind: 'build-settings' }>, |
no test coverage detected