mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[performance tests] Wait till project tree is expanded
GitOrigin-RevId: f3610441aa434418fcda5f38d2a68d0a5c71a214
This commit is contained in:
committed by
intellij-monorepo-bot
parent
073cee84c0
commit
dd53d68e4f
@@ -5,6 +5,7 @@ import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.ui.playback.PlaybackContext
|
||||
import com.intellij.openapi.ui.playback.commands.PlaybackCommandCoroutineAdapter
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
/**
|
||||
@@ -20,8 +21,12 @@ class ExpandProjectViewCommand(text: String, line: Int) : PlaybackCommandCorouti
|
||||
|
||||
override suspend fun doExecute(context: PlaybackContext) {
|
||||
val file = OpenFileCommand.findFile(extractCommandArgument(PREFIX), context.project)
|
||||
val mutex = Mutex(true)
|
||||
withContext(Dispatchers.EDT) {
|
||||
ProjectView.getInstance(context.project).select(null, file, false)
|
||||
ProjectView.getInstance(context.project).selectCB(null, file, false).doWhenProcessed {
|
||||
mutex.unlock()
|
||||
}
|
||||
}
|
||||
mutex.lock()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user