fix: Save all documents freezing progress
This commit is contained in:
parent
93d8deeec8
commit
a32068ce23
2 changed files with 9 additions and 8 deletions
|
@ -17,6 +17,11 @@ Changelog structure reference:
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Project
|
||||||
|
- "Save all documents" hanging when trying to run a zig file
|
||||||
|
|
||||||
## [20.0.2]
|
## [20.0.2]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -48,6 +48,7 @@ import org.jetbrains.concurrency.Promise
|
||||||
abstract class ZigProgramRunner<ProfileState : ZigProfileState<*>>(protected val executorId: String) : AsyncProgramRunner<RunnerSettings>() {
|
abstract class ZigProgramRunner<ProfileState : ZigProfileState<*>>(protected val executorId: String) : AsyncProgramRunner<RunnerSettings>() {
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
override fun execute(environment: ExecutionEnvironment, state: RunProfileState): Promise<RunContentDescriptor?> {
|
override fun execute(environment: ExecutionEnvironment, state: RunProfileState): Promise<RunContentDescriptor?> {
|
||||||
|
FileDocumentManager.getInstance().saveAllDocuments()
|
||||||
return environment.project.zigCoroutineScope.async {
|
return environment.project.zigCoroutineScope.async {
|
||||||
withModalProgress(ModalTaskOwner.project(environment.project), "Starting zig program...", TaskCancellation.cancellable()) {
|
withModalProgress(ModalTaskOwner.project(environment.project), "Starting zig program...", TaskCancellation.cancellable()) {
|
||||||
executeAsync(environment, state)
|
executeAsync(environment, state)
|
||||||
|
@ -71,13 +72,8 @@ abstract class ZigProgramRunner<ProfileState: ZigProfileState<*>>(protected val
|
||||||
}
|
}
|
||||||
|
|
||||||
return reportProgress { reporter ->
|
return reportProgress { reporter ->
|
||||||
reporter.indeterminateStep("Saving all documents") {
|
reporter.indeterminateStep {
|
||||||
withEDTContext {
|
execute(state, toolchain, environment)
|
||||||
FileDocumentManager.getInstance().saveAllDocuments()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return@reportProgress reporter.indeterminateStep {
|
|
||||||
return@indeterminateStep execute(state, toolchain, environment)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue