MCPcopy Index your code
hub / github.com/coder/mux / postMessage

Function postMessage

vscode/src/webview/vscodeBridge.ts:63–75  ·  view source on GitHub ↗
(payload: WebviewToExtensionMessage)

Source from the content-addressed store, hash-verified

61 });
62
63 const postMessage = (payload: WebviewToExtensionMessage): void => {
64 assert(payload && typeof payload === "object" && "type" in payload, "postMessage requires a payload with type");
65
66 const meta = {
67 traceId,
68 seq: nextSeq++,
69 sentAtMs: Date.now(),
70 sinceStartMs: Date.now() - startedAtMs,
71 };
72
73 const envelope: Record<string, unknown> = { __muxMeta: meta, ...payload };
74 vscode.postMessage(envelope);
75 };
76
77 const debugLog = (message: string, data?: unknown): void => {
78 // Mirror to DevTools console.

Callers 1

debugLogFunction · 0.85

Calls 2

assertFunction · 0.50
postMessageMethod · 0.45

Tested by

no test coverage detected