mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[indexing] IJPL-207117 Schedule scanning synchronously from ProjectFileBasedIndexStartupActivity to make sure that smartReadAction waits for the first scanning
GitOrigin-RevId: 5174b49bdf7ec50d8a815dc028f568a9436970c3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
14d9bd4852
commit
d247f73910
@@ -6,6 +6,7 @@ import com.intellij.openapi.application.readAction
|
||||
import com.intellij.openapi.application.readActionBlocking
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.openapi.util.ThrowableComputable
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.VirtualFileWithId
|
||||
@@ -145,11 +146,15 @@ private fun scheduleFullScanning(
|
||||
}
|
||||
else CompletableDeferred(Unit)
|
||||
val parameters = CompletableDeferred(ScanningIterators(indexingReason, null, null, fullScanningType))
|
||||
UnindexedFilesScanner(project, true, isFilterUpToDate,
|
||||
someDirtyFilesScheduledForIndexing.asCompletableFuture(),
|
||||
forceCheckingForOutdatedIndexesUsingFileModCount = notSeenIds !is AllNotSeenDirtyFileIds,
|
||||
scanningParameters = parameters)
|
||||
.queue()
|
||||
ApplicationManager.getApplication().invokeAndWait {
|
||||
ApplicationManager.getApplication().runWriteIntentReadAction(ThrowableComputable { // makes scanning to be scheduled immediately
|
||||
UnindexedFilesScanner(project, true, isFilterUpToDate,
|
||||
someDirtyFilesScheduledForIndexing.asCompletableFuture(),
|
||||
forceCheckingForOutdatedIndexesUsingFileModCount = notSeenIds !is AllNotSeenDirtyFileIds,
|
||||
scanningParameters = parameters)
|
||||
.queue()
|
||||
})
|
||||
}
|
||||
return someDirtyFilesScheduledForIndexing
|
||||
}
|
||||
|
||||
@@ -173,10 +178,14 @@ private fun scheduleDirtyFilesScanning(
|
||||
DirtyFilesIndexableFilesIterator(projectDirtyFilesFromOrphanQueue, true))
|
||||
|
||||
val scanningIterators = CompletableDeferred(ScanningIterators(indexingReason, iterators, null, partialScanningType))
|
||||
UnindexedFilesScanner(project, true, true,
|
||||
projectDirtyFiles.asCompletableFuture(),
|
||||
scanningParameters = scanningIterators)
|
||||
.queue()
|
||||
ApplicationManager.getApplication().invokeAndWait {
|
||||
ApplicationManager.getApplication().runWriteIntentReadAction(ThrowableComputable { // makes scanning to be scheduled immediately
|
||||
UnindexedFilesScanner(project, true, true,
|
||||
projectDirtyFiles.asCompletableFuture(),
|
||||
scanningParameters = scanningIterators)
|
||||
.queue()
|
||||
})
|
||||
}
|
||||
return projectDirtyFiles
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user