Skip to content

Commit 2a79a4e

Browse files
authored
save first when trigger test command (LeetCode-OpenSource#22)
1 parent 5d38633 commit 2a79a4e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/commands/test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export async function testSolution(channel: vscode.OutputChannel): Promise<void>
1818
vscode.window.showErrorMessage("Please open a LeetCode solution file first.");
1919
return;
2020
}
21+
if (!activeText.document.save()) {
22+
vscode.window.showWarningMessage("Please save the solution file first.");
23+
return;
24+
}
2125

2226
const filePath = activeText.document.uri.fsPath;
2327
const picks: Array<IQuickItemEx<string>> = [];

0 commit comments

Comments
 (0)