( name: string, state: WorksetsState )
| 277 | } |
| 278 | |
| 279 | export function worksetNotFoundError( |
| 280 | name: string, |
| 281 | state: WorksetsState |
| 282 | ): StoreError { |
| 283 | const savedNames = Object.keys(state.worksets).sort((a, b) => |
| 284 | a.localeCompare(b) |
| 285 | ); |
| 286 | return new StoreError( |
| 287 | `Workset '${name}' is not saved on this machine.`, |
| 288 | 'workset_not_found', |
| 289 | { |
| 290 | target: 'workset.name', |
| 291 | fix: |
| 292 | savedNames.length > 0 |
| 293 | ? `Saved worksets: ${savedNames.join(', ')}. See them with: openspec workset list` |
| 294 | : `Create it first: openspec workset create ${name}`, |
| 295 | } |
| 296 | ); |
| 297 | } |
| 298 | |
| 299 | export function withWorkset( |
| 300 | state: WorksetsState, |
no outgoing calls
no test coverage detected