fix!: bad modality states in some EDT calls

This commit is contained in:
FalsePattern 2025-03-27 23:04:16 +01:00
parent 78c4751c53
commit efa2f127a9
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
3 changed files with 5 additions and 5 deletions

View file

@ -89,7 +89,7 @@ class ZigDebuggerToolchainConfigurableUi : ZigDebuggerUiComponent {
row(ZigDebugBundle.message("settings.debugger.toolchain.debugger.label")) { row(ZigDebugBundle.message("settings.debugger.toolchain.debugger.label")) {
comment = cell(debuggerKindComboBox) comment = cell(debuggerKindComboBox)
.comment("", DEFAULT_COMMENT_WIDTH) { .comment("", DEFAULT_COMMENT_WIDTH) {
zigCoroutineScope.launchWithEDT(ModalityState.any()) { zigCoroutineScope.launchWithEDT(ModalityState.defaultModalityState()) {
withModalProgress(ModalTaskOwner.component(debuggerKindComboBox), "Downloading debugger", TaskCancellation.cancellable()) { withModalProgress(ModalTaskOwner.component(debuggerKindComboBox), "Downloading debugger", TaskCancellation.cancellable()) {
downloadDebugger() downloadDebugger()
} }
@ -97,7 +97,7 @@ class ZigDebuggerToolchainConfigurableUi : ZigDebuggerUiComponent {
} }
.applyToComponent { .applyToComponent {
whenItemSelected(null) { whenItemSelected(null) {
zigCoroutineScope.launchWithEDT(ModalityState.any()) { zigCoroutineScope.launchWithEDT(ModalityState.defaultModalityState()) {
this@ZigDebuggerToolchainConfigurableUi.update() this@ZigDebuggerToolchainConfigurableUi.update()
} }
} }
@ -112,7 +112,7 @@ class ZigDebuggerToolchainConfigurableUi : ZigDebuggerUiComponent {
cell(useClion) cell(useClion)
} }
} }
zigCoroutineScope.launchWithEDT(ModalityState.any()) { zigCoroutineScope.launchWithEDT(ModalityState.defaultModalityState()) {
update() update()
} }
} }

View file

@ -95,7 +95,7 @@ class ZigProjectSettingsPanel(private val holder: ZigProjectConfigurationProvide
} }
private fun dispatchAutodetect(force: Boolean) { private fun dispatchAutodetect(force: Boolean) {
project.zigCoroutineScope.launchWithEDT(ModalityState.any()) { project.zigCoroutineScope.launchWithEDT(ModalityState.defaultModalityState()) {
withModalProgress(ModalTaskOwner.component(pathToToolchain), "Detecting Zig...", TaskCancellation.cancellable()) { withModalProgress(ModalTaskOwner.component(pathToToolchain), "Detecting Zig...", TaskCancellation.cancellable()) {
autodetect(force) autodetect(force)
} }

View file

@ -279,7 +279,7 @@ class ZLSSettingsPanel(private val project: Project) : ZigProjectConfigurationPr
} }
private fun dispatchAutodetect(force: Boolean) { private fun dispatchAutodetect(force: Boolean) {
project.zigCoroutineScope.launchWithEDT(ModalityState.any()) { project.zigCoroutineScope.launchWithEDT(ModalityState.defaultModalityState()) {
withModalProgress(ModalTaskOwner.component(zlsPath), "Detecting ZLS...", TaskCancellation.cancellable()) { withModalProgress(ModalTaskOwner.component(zlsPath), "Detecting ZLS...", TaskCancellation.cancellable()) {
autodetect(force) autodetect(force)
} }