We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d06916 commit 5c66dd7Copy full SHA for 5c66dd7
src/commands/runTestFromCodeLens.ts
@@ -8,10 +8,24 @@ type RunArgs = {
8
module?: string;
9
};
10
11
-export default function runFromCodeLens(args: RunArgs): void {
+export default async function runFromCodeLens(args: RunArgs): Promise<void> {
12
+ const { activeTextEditor, terminals, createTerminal } = window;
13
+
14
+ if (!activeTextEditor) {
15
+ return;
16
+ }
17
18
+ if (activeTextEditor.document.isDirty) {
19
+ const saved = await activeTextEditor.document.save();
20
21
+ if (!saved) {
22
23
24
25
26
const elixirLsTerminal =
- window.terminals.find((terminal) => terminal.name == "ElixirLS") ||
- window.createTerminal("ElixirLS");
27
+ terminals.find((terminal) => terminal.name == "ElixirLS") ||
28
+ createTerminal("ElixirLS");
29
30
elixirLsTerminal.show();
31
elixirLsTerminal.sendText("clear");
0 commit comments