diff --git a/src/commands/test.ts b/src/commands/test.ts index 4ae2e190..21a24504 100644 --- a/src/commands/test.ts +++ b/src/commands/test.ts @@ -18,6 +18,10 @@ export async function testSolution(channel: vscode.OutputChannel): Promise vscode.window.showErrorMessage("Please open a LeetCode solution file first."); return; } + if (!activeText.document.save()) { + vscode.window.showWarningMessage("Please save the solution file first."); + return; + } const filePath = activeText.document.uri.fsPath; const picks: Array> = [];