* Returns the best socket path that we can connect to. * We also delete any sockets that we can't connect to.
(filePath: string)
| 129 | * We also delete any sockets that we can't connect to. |
| 130 | */ |
| 131 | async getConnectedSocketPath(filePath: string): Promise<string | undefined> { |
| 132 | const candidates = this.getCandidatesForFile(filePath) |
| 133 | let match: EditorSessionEntry | undefined = undefined |
| 134 | |
| 135 | for (const candidate of candidates) { |
| 136 | if (await canConnect(candidate.socketPath)) { |
| 137 | match = candidate |
| 138 | break |
| 139 | } |
| 140 | this.deleteSession(candidate.socketPath) |
| 141 | } |
| 142 | |
| 143 | return match?.socketPath |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | export class EditorSessionManagerClient { |
no test coverage detected