mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
IJPL-578,IDEA-347617: remove workaround for smartReadAction not waiting for scanning in unit tests
GitOrigin-RevId: d0bf5c092cfdb183d8d0847937c08db06d757f3f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
597cc08ccc
commit
2504cd1a1d
@@ -185,15 +185,6 @@ class IndexingTestUtil(private val project: Project) {
|
||||
IndexingTestUtil(project).waitUntilFinished()
|
||||
}
|
||||
|
||||
@Suppress("unused") // invoked from prod code via reflection
|
||||
@JvmStatic
|
||||
fun workaroundForEverSmartIdeInUnitTestsIDEA347619(project: Project) {
|
||||
// we don't need this workaround when SynchronousTaskQueue is not enabled
|
||||
if (DumbServiceImpl.useSynchronousTaskQueue) {
|
||||
IndexingTestUtil(project).waitUntilFinished()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun suspendUntilIndexesAreReady(project: Project) {
|
||||
IndexingTestUtil(project).suspendUntilIndexesAreReady()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.openapi.application.runWriteAction
|
||||
import com.intellij.openapi.externalSystem.service.project.manage.ProjectDataImportListener
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.util.application
|
||||
import com.intellij.util.concurrency.AppExecutorUtil
|
||||
import org.jetbrains.annotations.VisibleForTesting
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
@@ -37,13 +36,6 @@ fun showNewKotlinCompilerAvailableNotificationIfNeeded(project: Project) {
|
||||
val bundledCompilerVersion = KotlinPluginLayout.standaloneCompilerVersion
|
||||
if (!bundledCompilerVersion.isRelease) return
|
||||
|
||||
// TODO (IDEA-347617): workaround for the fact that ReadAction.nonBlocking doesn't wait for scanning
|
||||
if (application.isUnitTestMode) {
|
||||
Class.forName("com.intellij.testFramework.IndexingTestUtil")
|
||||
.getMethod("workaroundForEverSmartIdeInUnitTestsIDEA347619", Project::class.java)
|
||||
.invoke(null, project)
|
||||
}
|
||||
|
||||
ReadAction.nonBlocking(Callable {
|
||||
if (!project.containsNonScriptKotlinFile()) return@Callable null
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.intellij.psi.PsiManager
|
||||
import com.intellij.psi.search.DelegatingGlobalSearchScope
|
||||
import com.intellij.psi.search.FileTypeIndex
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.util.application
|
||||
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread
|
||||
import com.intellij.util.indexing.DumbModeAccessType
|
||||
import org.jetbrains.annotations.NonNls
|
||||
@@ -151,13 +150,6 @@ suspend fun getModulesWithKotlinFiles(project: Project, modulesWithKotlinFacets:
|
||||
val projectScope = project.projectScope()
|
||||
// nothing to configure if there is no Kotlin files in entire project
|
||||
|
||||
// TODO (IDEA-347619): workaround for the fact that smartReadAction doesn't wait for scanning
|
||||
if (application.isUnitTestMode) {
|
||||
Class.forName("com.intellij.testFramework.IndexingTestUtil")
|
||||
.getMethod("workaroundForEverSmartIdeInUnitTestsIDEA347619", Project::class.java)
|
||||
.invoke(null, project)
|
||||
}
|
||||
|
||||
val anyKotlinFileInProject = smartReadAction(project) {
|
||||
FileTypeIndex.containsFileOfType(KotlinFileType.INSTANCE, projectScope)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user