From 982b52d6e905b38c106f0b7cb1cb87143a75bc3d Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:37:44 -0400 Subject: [PATCH] add reload, send tasks. add reporter and build tasks --- .vscode/tasks.json | 14 +++++++++++++- src/plugins/devCompanion.dev/index.tsx | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5b160cb84..13297d624 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,6 +12,18 @@ "isDefault": true } }, + { + // for use with the vencord companion extension + "label": "BuildCompanionReporter", + "type": "shell", + "command": "pnpm build --dev --reporter --companion-test" + }, + { + "label": "BuildDev", + "type": "shell", + "command": "pnpm build --dev", + "group": "build" + }, { "label": "Watch", "type": "shell", @@ -22,4 +34,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/plugins/devCompanion.dev/index.tsx b/src/plugins/devCompanion.dev/index.tsx index 961c8dbf8..715a32408 100644 --- a/src/plugins/devCompanion.dev/index.tsx +++ b/src/plugins/devCompanion.dev/index.tsx @@ -23,6 +23,7 @@ import { Logger } from "@utils/Logger"; import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches"; import definePlugin, { OptionType, ReporterTestable } from "@utils/types"; import { filters, findAll, search, wreq } from "@webpack"; +import { reporterData } from "debug/runReporter"; import { extractModule, extractOrThrow, FindData, findModuleId, FindType, mkRegexFind, parseNode, PatchData, SendData } from "./util"; @@ -67,6 +68,12 @@ function initWs(isManual = false) { data: Object.keys(wreq.m), ok: true, }); + // if we are running the reporter with companion integration, send the list to vscode as soon as we can + replyData({ + type: "report", + data: reporterData, + ok: true + }); (settings.store.notifyOnAutoConnect || isManual) && showNotification({ title: "Dev Companion Connected", @@ -174,6 +181,10 @@ function initWs(isManual = false) { } break; } + case "reload": { + window.location.reload(); + break; + } case "extract": { try { const { extractType, idOrSearch } = data;