mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 00:40:28 +07:00
[platform] add more checkCanceled
- scopes - workspace model KTIJ-33238 (cherry picked from commit f231052bb7130617d73c6dd411a6f915eaa6e9aa) IJ-CR-166541 GitOrigin-RevId: c9beffca994b33b9ea12554f8ec149ca9ad9c3d9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c9d7ce3a9c
commit
8931c9fbe8
@@ -3,6 +3,7 @@ package com.intellij.psi.search;
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeRegistry;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.search.impl.VirtualFileEnumeration;
|
||||
import com.intellij.psi.search.impl.VirtualFileEnumerationAware;
|
||||
@@ -27,6 +28,7 @@ final class FileTypeRestrictionScope extends DelegatingGlobalSearchScope impleme
|
||||
if (!super.contains(file)) return false;
|
||||
|
||||
for (FileType otherFileType : myFileTypes) {
|
||||
ProgressManager.checkCanceled();
|
||||
if (FileTypeRegistry.getInstance().isFileOfType(file, otherFileType)) return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.psi.search;
|
||||
import com.intellij.core.CoreBundle;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.UnloadedModuleDescription;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -104,7 +105,10 @@ final class UnionScope extends GlobalSearchScope implements VirtualFileEnumerati
|
||||
|
||||
@Override
|
||||
public boolean contains(final @NotNull VirtualFile file) {
|
||||
return ContainerUtil.find(myScopes, scope -> scope.contains(file)) != null;
|
||||
return ContainerUtil.find(myScopes, scope -> {
|
||||
ProgressManager.checkCanceled();
|
||||
return scope.contains(file);
|
||||
}) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.extensions.ExtensionPointListener
|
||||
import com.intellij.openapi.extensions.ExtensionPointPriorityListener
|
||||
import com.intellij.openapi.extensions.PluginDescriptor
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
@@ -283,6 +284,7 @@ open class ModuleDependencyIndexImpl(private val project: Project): ModuleDepend
|
||||
}
|
||||
|
||||
fun hasDependencyOn(library: Library): Boolean {
|
||||
ProgressManager.checkCanceled()
|
||||
return when (library) {
|
||||
is LibraryBridge -> hasDependencyOn(library.libraryId)
|
||||
is LibraryModifiableModelBridge -> hasDependencyOn(library.libraryId)
|
||||
|
||||
Reference in New Issue
Block a user