| 17 | export const flutterTestDeviceIsWeb = flutterTestDeviceId === "chrome" || flutterTestDeviceId === "web-server"; |
| 18 | |
| 19 | export async function startDebugger(dc: DartDebugClient, script?: Uri | string, extraConfiguration?: Record<string, any>): Promise<DebugConfiguration & DartVsCodeLaunchArgs & DebugProtocol.LaunchRequestArguments> { |
| 20 | if (dc.debuggerType === DebuggerType.Flutter || dc.debuggerType === DebuggerType.FlutterTest) { |
| 21 | extraConfiguration = Object.assign( |
| 22 | { deviceId: flutterTestDeviceId }, |
| 23 | extraConfiguration, |
| 24 | ); |
| 25 | } |
| 26 | const config = await getLaunchConfiguration(script, extraConfiguration); |
| 27 | if (!config) |
| 28 | throw new Error(`Could not get launch configuration (got ${config})`); |
| 29 | |
| 30 | await watchPromise("startDebugger->start", dc.start()); |
| 31 | return config satisfies DebugConfiguration & DartVsCodeLaunchArgs & DebugProtocol.LaunchRequestArguments; |
| 32 | } |
| 33 | |
| 34 | export function createDebugClient(debuggerType: DebuggerType) { |
| 35 | const descriptor = privateApi.debugAdapterDescriptorFactory.descriptorForType(debuggerType); |