Run server

This commit is contained in:
2026-02-08 02:35:42 +01:00
parent e8df455611
commit a0be2553cb
5 changed files with 1005 additions and 44 deletions
+27 -6
View File
@@ -2,15 +2,29 @@ import * as vscode from "vscode";
export var currentRun: NodeJS.Timeout | null = null;
export async function stopRun() {
if (currentRun) clearTimeout(currentRun);
}
export async function startRun(
statusBarItem: vscode.StatusBarItem,
problemId: string,
problemId?: string,
) {
if (currentRun) {
vscode.window.showErrorMessage("You are already in a run");
return;
}
if (!problemId) {
problemId = await vscode.window.showInputBox({
prompt: "Enter a valid problem ID",
placeHolder: "my-problem",
validateInput: (text) => {
return text.match(/^[a-zA-Z0-9-]+$/)
? null
: "Must only contain '-' and alphanumeric characters";
},
});
}
if (!problemId) return;
const mode = await vscode.window.showQuickPick(["any%", "100%"], {
placeHolder: "Select a mode",
canPickMany: false,
@@ -30,3 +44,10 @@ export async function startRun(
.padStart(2, "0")}`;
}, 50);
}
export async function stopRun() {
if (currentRun) {
clearTimeout(currentRun);
currentRun = null;
}
}