Skip to content

Commit 8a2e422

Browse files
committed
fix(run): handle run failure and cleanup scratch file #257
1 parent f64158a commit 8a2e422

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevRunAction.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ class AutoDevRunAction : DumbAwareAction() {
4646
?: return
4747

4848
try {
49-
RunService.provider(project, file)?.runFile(
49+
RunService.provider(project, file)
50+
?.runFile(project, scratchFile, psiFile) ?: AutoDevNotifications.notify(
5051
project,
51-
scratchFile,
52-
psiFile,
52+
"Run Failed, no provider"
5353
)
5454
} finally {
5555
AutoDevNotifications.notify(project, "Run Success")
56-
// runWriteAction {
57-
// scratchFile.delete(this)
58-
// }
56+
runWriteAction {
57+
scratchFile.delete(this)
58+
}
5959
}
6060
}
6161
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/file:src

0 commit comments

Comments
 (0)