mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
Use only one ProjectCloseListener to have more control over order
GitOrigin-RevId: ef2f37c5989b10d94b765e55f0901de7d84688e3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2d99d38d8d
commit
3fe717a7bc
@@ -296,6 +296,7 @@ public final class FileBasedIndexImpl extends FileBasedIndexEx {
|
||||
persistDirtyFiles(project);
|
||||
getChangedFilesCollector().getDirtyFiles().removeProject(project);
|
||||
myFilesToUpdateCollector.getDirtyFiles().removeProject(project);
|
||||
myIndexableFilesFilterHolder.onProjectClosing(project);
|
||||
}
|
||||
|
||||
boolean processChangedFiles(@NotNull Project project, @NotNull Processor<? super VirtualFile> processor) {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util.indexing.projectFilter
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ReadAction
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.progress.util.ProgressIndicatorUtils
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.project.ProjectCloseListener
|
||||
import com.intellij.util.SmartList
|
||||
import com.intellij.util.SystemProperties
|
||||
import com.intellij.util.containers.SmartHashSet
|
||||
@@ -39,17 +37,15 @@ internal sealed class ProjectIndexableFilesFilterHolder {
|
||||
abstract fun findProjectsForFile(fileId: Int): Set<Project>
|
||||
|
||||
abstract fun runHealthCheck()
|
||||
|
||||
abstract fun onProjectClosing(project: Project)
|
||||
}
|
||||
|
||||
internal class IncrementalProjectIndexableFilesFilterHolder : ProjectIndexableFilesFilterHolder() {
|
||||
private val myProjectFilters: ConcurrentMap<Project, ProjectIndexableFilesFilter> = ConcurrentHashMap()
|
||||
|
||||
init {
|
||||
ApplicationManager.getApplication().messageBus.connect().subscribe(ProjectCloseListener.TOPIC, object : ProjectCloseListener {
|
||||
override fun projectClosed(project: Project) {
|
||||
myProjectFilters.remove(project)
|
||||
}
|
||||
})
|
||||
override fun onProjectClosing(project: Project) {
|
||||
myProjectFilters.remove(project)
|
||||
}
|
||||
|
||||
override fun getProjectIndexableFiles(project: Project): IdFilter? {
|
||||
|
||||
Reference in New Issue
Block a user