Conversation
See microsoft/playwright-vscode#684 for the other side.
src/reusedBrowser.ts
Outdated
| this._pageCountChanged(params.pageCount); | ||
| this._onPageCountChangedEvent.fire(this.pageCount()); | ||
|
|
||
| if (backend === this._backend) { |
There was a problem hiding this comment.
Why do we need this logic now? It was not present before.
There was a problem hiding this comment.
We had it, it was in this._pageCountChanged().
src/reusedBrowser.ts
Outdated
| this._backend = undefined; | ||
| if (backend === this._testingBackend) { | ||
| this._testingBackend = undefined; | ||
| void this._reset('none'); |
There was a problem hiding this comment.
I think this logic should later apply to the "currently recording backend", once you implement recording in all backends.
src/reusedBrowser.ts
Outdated
| void this._vscode.window.showErrorMessage(e.message); | ||
| this._backend = undefined; | ||
| this._testingBackend = undefined; | ||
| void this._reset('none'); |
| private async _startBackendIfNeeded(model: TestModel): Promise<{ errors?: string[] }> { | ||
| // Unconditionally close selector dialog, it might send inspect(enabled: false). | ||
| if (this._backend) { | ||
| if (this._testingBackend) { |
There was a problem hiding this comment.
Let's follow up with making this piece understandable, as discussed offline.
| void this._vscode.window.showErrorMessage(e.message); | ||
| this._backend = undefined; | ||
| void this._reset('none'); | ||
| void this._reset('none', this._testingBackend); |
There was a problem hiding this comment.
It feels like this call should be inside the handler on the line 147 instead. Same goes for lines 115 and 143.
There was a problem hiding this comment.
For onError, maybe. But not for onClose, since the extension doesn't control the MCP lifecycle. I'll revisit this once I implement recording for MCP.
This reverts commit d1f0c31.
See microsoft/playwright-vscode#684 for the other side.
Scans
vscode.lm.toolsfor Playwright MCP instances, and calls thebrowser_connecttool to establish a DebugController connection with them. microsoft/playwright-mcp#979 shows its implementation.These debug controllers can then be shown from the browser list, just like the test-runner controlled debug controllers.