add reload, send tasks. add reporter and build tasks

This commit is contained in:
sadan 2024-08-20 19:37:44 -04:00
parent 7fe1b2dbd4
commit 982b52d6e9
No known key found for this signature in database
2 changed files with 24 additions and 1 deletions

14
.vscode/tasks.json vendored
View file

@ -12,6 +12,18 @@
"isDefault": true "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", "label": "Watch",
"type": "shell", "type": "shell",
@ -22,4 +34,4 @@
} }
} }
] ]
} }

View file

@ -23,6 +23,7 @@ import { Logger } from "@utils/Logger";
import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches"; import { canonicalizeMatch, canonicalizeReplace } from "@utils/patches";
import definePlugin, { OptionType, ReporterTestable } from "@utils/types"; import definePlugin, { OptionType, ReporterTestable } from "@utils/types";
import { filters, findAll, search, wreq } from "@webpack"; import { filters, findAll, search, wreq } from "@webpack";
import { reporterData } from "debug/runReporter";
import { extractModule, extractOrThrow, FindData, findModuleId, FindType, mkRegexFind, parseNode, PatchData, SendData } from "./util"; 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), data: Object.keys(wreq.m),
ok: true, 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({ (settings.store.notifyOnAutoConnect || isManual) && showNotification({
title: "Dev Companion Connected", title: "Dev Companion Connected",
@ -174,6 +181,10 @@ function initWs(isManual = false) {
} }
break; break;
} }
case "reload": {
window.location.reload();
break;
}
case "extract": { case "extract": {
try { try {
const { extractType, idOrSearch } = data; const { extractType, idOrSearch } = data;