(
status: IDEConnectionStatus,
details?: string,
logToConsole = false,
)
| 226 | } |
| 227 | |
| 228 | private setState( |
| 229 | status: IDEConnectionStatus, |
| 230 | details?: string, |
| 231 | logToConsole = false, |
| 232 | ) { |
| 233 | const isAlreadyDisconnected = |
| 234 | this.state.status === IDEConnectionStatus.Disconnected && |
| 235 | status === IDEConnectionStatus.Disconnected; |
| 236 | |
| 237 | // Only update details & log to console if the state wasn't already |
| 238 | // disconnected, so that the first detail message is preserved. |
| 239 | if (!isAlreadyDisconnected) { |
| 240 | this.state = { status, details }; |
| 241 | if (details) { |
| 242 | if (logToConsole) { |
| 243 | logger.error(details); |
| 244 | } else { |
| 245 | // We only want to log disconnect messages to debug |
| 246 | // if they are not already being logged to the console. |
| 247 | logger.debug(details); |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | if (status === IDEConnectionStatus.Disconnected) { |
| 253 | ideContext.clearIdeContext(); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | static validateWorkspacePath( |
| 258 | ideWorkspacePath: string | undefined, |
no test coverage detected