(id: string | undefined)
| 744 | // workspace; throws on an unknown id. Omitted ids fall through |
| 745 | // to the first backend in the list (the default). |
| 746 | #resolveBackendId(id: string | undefined): string | undefined { |
| 747 | if (this.#registeredBackendIds.size === 0) return undefined; |
| 748 | const target = id ?? this.#defaultBackendId; |
| 749 | if (target === undefined) return undefined; |
| 750 | if (!this.#registeredBackendIds.has(target)) { |
| 751 | throw new Error( |
| 752 | `Workspace: no backend with id ${JSON.stringify(target)}. ` + |
| 753 | `Configured backends: ${[...this.#registeredBackendIds].map((key) => JSON.stringify(key)).join(", ") || "<none>"}.`, |
| 754 | ); |
| 755 | } |
| 756 | return target; |
| 757 | } |
| 758 | |
| 759 | #resolveCommandBackendId(id: string | undefined): string | undefined { |
| 760 | const target = id ?? this.#defaultCommandBackendId; |
no test coverage detected