src/vs/workbench/services/extensions/common/rpcProtocol.ts/MessageIO/serializeReplyOK
class MessageIO:	public static serializeReplyOK(req: number, res: any, replacer: JSONStringifyReplacer | null): VSBuffer {
		if (typeof res === 'undefined') {
			return this._serializeReplyOKEmpty(req);
		} else if (res instanceof VSBuffer) {
			return this._serializeReplyOKVSBuffer(req, res);
		} else if (res instanceof SerializableObjectWithBuffers) {
			const { jsonString, referencedBuffers } = stringifyJsonWithBufferRefs(res.value, replacer, true);
			return this._serializeReplyOKJSONWithBuffers(req, jsonString, referencedBuffers);
		} else {
			return this._serializeReplyOKJSON(req, safeStringify(res, replacer));
		}
	}