Skip to content

Commit

Permalink
feat: reload page on attached restart
Browse files Browse the repository at this point in the history
Fixes #1004
  • Loading branch information
connor4312 committed Jun 10, 2021
1 parent 69d988b commit c0875f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he

## Nightly

- feat: reload page on attached restart ([#1004](https://github.com/microsoft/vscode-js-debug/issues/1004))
- fix: default F5 not working on files outside workspace ([ref](https://github.com/microsoft/vscode/issues/125796))
- fix: debugging with no launch config fails when tsc task detection is disabled ([ref](https://github.com/microsoft/vscode/issues/69572))
- fix: race causing lost sessions when attaching to many concurrent processes in the debug terminal ([ref](https://github.com/microsoft/vscode/issues/124060))
Expand Down
11 changes: 10 additions & 1 deletion src/targets/browser/browserAttacher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { VSCodeApi } from '../../ioc-extras';
import { ITelemetryReporter } from '../../telemetry/telemetryReporter';
import { ILaunchContext, ILauncher, ILaunchResult, IStopMetadata, ITarget } from '../targets';
import { BrowserTargetManager } from './browserTargetManager';
import { BrowserTargetType } from './browserTargets';
import * as launcher from './launcher';

const localize = nls.loadMessageBundle();
Expand Down Expand Up @@ -280,7 +281,15 @@ export class BrowserAttacher<
}

async restart(): Promise<void> {
// no-op
if (!this._targetManager) {
return;
}

for (const target of this._targetManager.targetList()) {
if (target.type() === BrowserTargetType.Page) {
target.restart();
}
}
}

targetList(): ITarget[] {
Expand Down
3 changes: 1 addition & 2 deletions src/targets/browser/browserTargetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { AnyChromiumConfiguration } from '../../configuration';
import { IBrowserVersionMetrics } from '../../telemetry/classification';
import { ITelemetryReporter } from '../../telemetry/telemetryReporter';
import { ITargetOrigin } from '../targetOrigin';
import { ITarget } from '../targets';
import { BrowserTarget, BrowserTargetType, domDebuggerTypes, jsTypes } from './browserTargets';
import { FrameModel } from './frames';
import { ServiceWorkerModel } from './serviceWorkers';
Expand Down Expand Up @@ -87,7 +86,7 @@ export class BrowserTargetManager implements IDisposable {
this.serviceWorkerModel.dispose();
}

targetList(): ITarget[] {
targetList() {
return Array.from(this._targets.values()).filter(target => jsTypes.has(target.type()));
}

Expand Down

0 comments on commit c0875f1

Please sign in to comment.