Skip to content

Commit

Permalink
Returning code changed for market validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hello-zoka committed Dec 3, 2024
1 parent df8dbc7 commit dae1a35
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.application.ex.ApplicationManagerEx
import com.intellij.openapi.progress.util.ProgressIndicatorBase
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ex.ProjectManagerEx
import com.intellij.openapi.startup.StartupManager
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.vfs.LocalFileSystem
Expand All @@ -25,6 +27,7 @@ import org.jetbrains.plugins.gradle.GradleCommandLineProjectConfigurator
import org.slf4j.LoggerFactory
import java.nio.file.Path
import java.util.function.Predicate
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine

class ProjectConfiguratorException : Exception {
Expand Down Expand Up @@ -158,18 +161,14 @@ object ProjectApplicationUtils {

private fun closeProject(project: Project) {
logger.info("Closing project $project...")
ApplicationManager.getApplication().assertIsNonDispatchThread()
// ToDo: move headless mode to another branch
// ApplicationManager.getApplication().invokeAndWait {
// ProjectManagerEx.getInstanceEx().forceCloseProject(project)
// }
ApplicationManager.getApplication().invokeAndWait {
ProjectManagerEx.getInstanceEx().forceCloseProject(project)
}
}

private suspend fun waitAllStartupActivitiesPassed(project: Project): Unit = suspendCoroutine {
logger.info("Waiting all startup activities passed $project...")
// ToDo: move headless mode to another branch
// StartupManager.getInstance(project).runAfterOpened { it.resume(Unit) }
waitForInvokeLaterActivities()
StartupManager.getInstance(project).runAfterOpened { it.resume(Unit) }
}

/**
Expand Down

0 comments on commit dae1a35

Please sign in to comment.