File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
src/com/magento/idea/magento2plugin/indexes Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 1212import com .intellij .psi .PsiDirectory ;
1313import com .intellij .psi .PsiManager ;
1414import com .intellij .psi .search .GlobalSearchScope ;
15+ import com .intellij .util .SlowOperations ;
1516import com .intellij .util .indexing .FileBasedIndex ;
1617import com .jetbrains .php .lang .PhpFileType ;
1718import com .magento .idea .magento2plugin .magento .packages .Package ;
@@ -116,6 +117,7 @@ private List<String> getNames(
116117 * Returns PSI directory of the certain module.
117118 *
118119 * @param moduleName String
120+ *
119121 * @return PsiDirectory
120122 */
121123 public @ Nullable PsiDirectory getModuleDirectoryByModuleName (final String moduleName ) {
@@ -124,14 +126,20 @@ private List<String> getNames(
124126 }
125127 final FileBasedIndex index = FileBasedIndex
126128 .getInstance ();
127-
128- final Collection <VirtualFile > files = index .getContainingFiles (
129- ModuleNameIndex .KEY ,
130- moduleName ,
131- GlobalSearchScope .getScopeRestrictedByFileTypes (
132- GlobalSearchScope .allScope (project ),
133- PhpFileType .INSTANCE
134- ));
129+ final Collection <VirtualFile > files = new ArrayList <>();
130+
131+ SlowOperations .allowSlowOperations (() -> {
132+ files .addAll (
133+ index .getContainingFiles (
134+ ModuleNameIndex .KEY ,
135+ moduleName ,
136+ GlobalSearchScope .getScopeRestrictedByFileTypes (
137+ GlobalSearchScope .allScope (project ),
138+ PhpFileType .INSTANCE
139+ )
140+ )
141+ );
142+ });
135143
136144 if (files .isEmpty ()) {
137145 return null ;
You can’t perform that action at this time.
0 commit comments