Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const testDone = notification as TestDoneNotification;
suiteID = this.tests[testDone.testID].suiteID;
break;
case "print":
const print = notification as PrintNotification;
suiteID = this.tests[print.testID].suiteID;
break;
case "error":
const error = notification as ErrorNotification;
suiteID = this.tests[error.testID].suiteID;
break;
}
const suitePath = suiteID !== undefined ? this.suitePaths[suiteID] : undefined;
if (suitePath) {
this.sendEvent(new Event(
"dart.testRunNotification",
{ suitePath, notification },
));
}
}
}
const isolatesResponses = await Promise.all(isolatePromises);
const isolates = isolatesResponses.map((response) => response.result as VMIsolate);
let current = 0;
let total = 0;
for (const isolate of isolates) {
if (!isolate._heaps)
continue;
for (const heap of [isolate._heaps.old, isolate._heaps.new]) {
current += heap.used + heap.external;
total += heap.capacity + heap.external;
}
}
this.sendEvent(new Event("dart.debugMetrics", { memory: { current, total } }));
if (this.pollforMemoryMs)
setTimeout(() => this.pollForMemoryUsage(), this.pollforMemoryMs).unref();
}
private log(message: string, severity: LogSeverity, category = this.category): void {
this.debugClient.sendEvent(new Event("dart.log", { message, severity, category } as LogMessage));
}
await this.runDaemon.callServiceExtension(this.currentRunningAppId, args.type, args.params);
this.sendResponse(response);
break;
case "checkPlatformOverride":
if (this.currentRunningAppId && this.runDaemon) {
const result = await this.runDaemon.callServiceExtension(this.currentRunningAppId, "ext.flutter.platformOverride", undefined);
this.sendEvent(new Event("dart.flutter.updatePlatformOverride", { platform: result.value }));
}
this.sendResponse(response);
break;
case "checkIsWidgetCreationTracked":
if (this.currentRunningAppId && this.runDaemon) {
const result = await this.runDaemon.callServiceExtension(this.currentRunningAppId, "ext.flutter.inspector.isWidgetCreationTracked", undefined);
this.sendEvent(new Event("dart.flutter.updateIsWidgetCreationTracked", { isWidgetCreationTracked: result.result }));
}
this.sendResponse(response);
break;
case "hotReload":
if (this.currentRunningAppId)
await this.performReload(false, args && args.reason || restartReasonManual);
this.sendResponse(response);
break;
case "hotRestart":
if (this.currentRunningAppId)
await this.performReload(true, args && args.reason || restartReasonManual);
this.sendResponse(response);
break;
private notifyServiceRegistered(service: string, method: string | undefined) {
this.sendEvent(new Event("dart.serviceRegistered", { service, method }));
}
private handleSystemWarning(message: DebuggerMessage): void {
this.logEvent(message);
if (message.sobject.Description) {
this.sendEvent(
new Event(SHOW_MESSAGE_EVENT, {
type: VscodeDebuggerMessageType.Warning,
message: message.sobject.Description
} as VscodeDebuggerMessage)
);
}
}
private notifyServiceExtensionAvailable(id: string) {
this.sendEvent(new Event("dart.serviceExtensionAdded", { id }));
}