How to use the vscode-debugadapter.Event function in vscode-debugadapter

To help you get started, we’ve selected a few vscode-debugadapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Dart-Code / Dart-Code / src / debug / dart_test_debug_impl.ts View on Github external
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 },
			));
		}
	}
}
github Dart-Code / Dart-Code / src / debug / dart_debug_impl.ts View on Github external
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();
	}
github Dart-Code / Dart-Code / src / debug / logging.ts View on Github external
private log(message: string, severity: LogSeverity, category = this.category): void {
		this.debugClient.sendEvent(new Event("dart.log", { message, severity, category } as LogMessage));
	}
github Dart-Code / Dart-Code / src / debug / flutter_debug_impl.ts View on Github external
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;
github Dart-Code / Dart-Code / src / debug / dart_debug_impl.ts View on Github external
private notifyServiceRegistered(service: string, method: string | undefined) {
		this.sendEvent(new Event("dart.serviceRegistered", { service, method }));
	}
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-apex-debugger / src / adapter / apexDebug.ts View on Github external
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)
      );
    }
  }
github Dart-Code / Dart-Code / src / debug / dart_debug_impl.ts View on Github external
private notifyServiceExtensionAvailable(id: string) {
		this.sendEvent(new Event("dart.serviceExtensionAdded", { id }));
	}