fix: crash with remote projects

This commit is contained in:
FalsePattern 2025-01-15 20:05:11 +01:00
parent 14c909d50e
commit 9135cc6dd6
Signed by: falsepattern
GPG key ID: E930CDEC50C50E23
2 changed files with 8 additions and 3 deletions

View file

@ -17,6 +17,11 @@ Changelog structure reference:
## [Unreleased]
### Fixed
- Project
- Zig Build tool window crashes when opening remote projects
## [20.1.2]
### Fixed

View file

@ -22,15 +22,15 @@
package com.falsepattern.zigbrains.project.steps.ui
import com.falsepattern.zigbrains.shared.coroutine.runModalOrBlocking
import com.falsepattern.zigbrains.shared.zigCoroutineScope
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowFactory
import com.intellij.platform.ide.progress.ModalTaskOwner
import kotlinx.coroutines.launch
class BuildToolWindowFactory: ToolWindowFactory {
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
runModalOrBlocking({ModalTaskOwner.project(project)}, {"BuildToolWindowFactory.createToolWindowContent"}) {
project.zigCoroutineScope.launch {
BuildToolWindowContext.create(project, toolWindow)
}
}