()
| 300 | } |
| 301 | |
| 302 | private async getPortFromFile(): Promise<string | undefined> { |
| 303 | try { |
| 304 | const ideProcessId = await getIdeProcessId(); |
| 305 | const portFile = path.join( |
| 306 | os.tmpdir(), |
| 307 | `anus-ide-server-${ideProcessId}.json`, |
| 308 | ); |
| 309 | const portFileContents = await fs.promises.readFile(portFile, 'utf8'); |
| 310 | const port = JSON.parse(portFileContents).port; |
| 311 | return port.toString(); |
| 312 | } catch (_) { |
| 313 | return undefined; |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | private registerClientHandlers() { |
| 318 | if (!this.client) { |
no test coverage detected