()
| 197 | return this._isStarted; |
| 198 | } |
| 199 | public async startService(): Promise<void> { |
| 200 | // Provides core liveshare functionality |
| 201 | // The shared service is used as a RPC service |
| 202 | // to pass messages between the host and guests |
| 203 | service = await liveSession.shareService(ShareProviderName); |
| 204 | if (service) { |
| 205 | this._isStarted = true; |
| 206 | for (const command in Commands.host) { |
| 207 | void liveShareOnRequest(command, Commands.host[command], service); |
| 208 | console.log(`[HostService] added ${command} callback`); |
| 209 | } |
| 210 | } else { |
| 211 | console.error('[HostService] service activation failed'); |
| 212 | } |
| 213 | } |
| 214 | public async stopService(): Promise<void> { |
| 215 | await liveSession.unshareService(ShareProviderName); |
| 216 | service = null; |
no test coverage detected