( private readonly logger: Logger, private readonly fileTracker: FileTracker, private context: Context, private workspaceContext: DartWorkspaceContext, readonly dartCapabilities: DartCapabilities, readonly flutterCapabilities: FlutterCapabilities, private readonly devTools: DevToolsManager, private readonly logging: LoggingCommands, )
| 83 | private currentHotRestartProgressId: string | undefined; |
| 84 | |
| 85 | constructor( |
| 86 | private readonly logger: Logger, |
| 87 | private readonly fileTracker: FileTracker, |
| 88 | private context: Context, |
| 89 | private workspaceContext: DartWorkspaceContext, |
| 90 | readonly dartCapabilities: DartCapabilities, |
| 91 | readonly flutterCapabilities: FlutterCapabilities, |
| 92 | private readonly devTools: DevToolsManager, |
| 93 | private readonly logging: LoggingCommands, |
| 94 | ) { |
| 95 | this.vmServices = new VmServiceExtensions(logger, this, workspaceContext, flutterCapabilities); |
| 96 | this.devTools.debugCommands = this; |
| 97 | this.debugOptions.name = "Dart Debug Options"; |
| 98 | this.disposables.push(this.debugOptions); |
| 99 | this.debugMetrics.name = "Dart Debug Metrics"; |
| 100 | this.disposables.push(this.debugMetrics); |
| 101 | this.debugSessionsStatusItem.name = "Dart Debug Sessions"; |
| 102 | this.updateDebugSessionsStatus(); |
| 103 | |
| 104 | this.disposables.push(vs.debug.onDidChangeBreakpoints((e) => this.handleBreakpointChange(e))); |
| 105 | this.disposables.push(vs.debug.onDidStartDebugSession((s) => this.handleDebugSessionStart(s))); |
| 106 | this.disposables.push(vs.debug.onDidReceiveDebugSessionCustomEvent((e) => this.handleDebugSessionCustomEvent(e))); |
| 107 | this.disposables.push(vs.debug.onDidTerminateDebugSession((s) => this.handleDebugSessionEnd(s))); |
| 108 | this.disposables.push(this.logging.onCaptureLogs((isCapturing) => this.setSendLogsToClient(isCapturing))); |
| 109 | |
| 110 | // Handle enabling Run/Debug buttons for the file if an entry point or have a main() method. |
| 111 | if (this.fileTracker) |
| 112 | this.disposables.push(this.fileTracker.onOutline(() => this.updateRunnableContexts())); |
| 113 | this.disposables.push(vs.window.onDidChangeActiveTextEditor(() => this.updateRunnableContexts())); |
| 114 | // Run for current open editor. |
| 115 | this.updateRunnableContexts(); |
| 116 | |
| 117 | this.disposables.push(vs.commands.registerCommand("flutter.overridePlatform", () => this.vmServices.overridePlatform())); |
| 118 | this.disposables.push(vs.commands.registerCommand("flutter.toggleDebugPainting", () => this.vmServices.toggle(VmServiceExtension.DebugPaint))); |
| 119 | this.disposables.push(vs.commands.registerCommand("flutter.togglePerformanceOverlay", () => this.vmServices.toggle(VmServiceExtension.PerformanceOverlay))); |
| 120 | this.disposables.push(vs.commands.registerCommand("flutter.toggleBrightness", () => this.vmServices.toggle(VmServiceExtension.BrightnessOverride, "Brightness.dark", "Brightness.light"))); |
| 121 | this.disposables.push(vs.commands.registerCommand("flutter.toggleRepaintRainbow", () => this.vmServices.toggle(VmServiceExtension.RepaintRainbow))); |
| 122 | this.disposables.push(vs.commands.registerCommand("flutter.toggleDebugModeBanner", () => this.vmServices.toggle(VmServiceExtension.DebugBanner))); |
| 123 | this.disposables.push(vs.commands.registerCommand("flutter.togglePaintBaselines", () => this.vmServices.toggle(VmServiceExtension.PaintBaselines))); |
| 124 | this.disposables.push(vs.commands.registerCommand("flutter.toggleSlowAnimations", () => this.vmServices.toggle(VmServiceExtension.SlowAnimations, timeDilationNormal, timeDilationSlow))); |
| 125 | this.disposables.push(vs.commands.registerCommand("flutter.inspectWidget", () => { |
| 126 | this.autoCancelNextInspectWidgetMode = false; |
| 127 | void this.vmServices.toggle(VmServiceExtension.InspectorSelectMode, true, true); |
| 128 | })); |
| 129 | this.disposables.push(vs.commands.registerCommand("flutter.inspectWidget.autoCancel", () => { |
| 130 | this.autoCancelNextInspectWidgetMode = true; |
| 131 | void this.vmServices.toggle(VmServiceExtension.InspectorSelectMode, true, true); |
| 132 | })); |
| 133 | this.disposables.push(vs.commands.registerCommand("flutter.cancelInspectWidget", () => { |
| 134 | this.autoCancelNextInspectWidgetMode = false; |
| 135 | void this.vmServices.toggle(VmServiceExtension.InspectorSelectMode, false, false); |
| 136 | })); |
| 137 | |
| 138 | this.disposables.push(vs.commands.registerCommand("dart.openObservatory", async () => { |
| 139 | const session = await this.getDebugSession(); |
| 140 | if (session && !session.session.configuration.noDebug && session.observatoryUri) { |
| 141 | await envUtils.openInBrowser(session.observatoryUri); |
| 142 | } else if (session) { |
nothing calls this directly
no test coverage detected