forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexManager.java
36 lines (33 loc) · 1.08 KB
/
IndexManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.magento.idea.magento2plugin.indexes;
import com.intellij.util.indexing.FileBasedIndexImpl;
import com.intellij.util.indexing.ID;
import com.magento.idea.magento2plugin.stubs.indexes.*;
import com.magento.idea.magento2plugin.stubs.indexes.xml.PhpClassNameIndex;
/**
* Created by dkvashnin on 1/9/16.
*/
public class IndexManager {
public static void manualReindex() {
ID<?, ?>[] indexIds = new ID<?, ?>[] {
// php
ModulePackageIndex.KEY,
// xml|di configuration
PluginIndex.KEY,
VirtualTypeIndex.KEY,
// layouts
BlockNameIndex.KEY,
ContainerNameIndex.KEY,
// events
EventNameIndex.KEY,
EventObserverIndex.KEY,
// webapi
WebApiTypeIndex.KEY,
ModuleNameIndex.KEY,
PhpClassNameIndex.KEY
};
for (ID<?, ?> id: indexIds) {
FileBasedIndexImpl.getInstance().requestRebuild(id);
FileBasedIndexImpl.getInstance().scheduleRebuild(id, new Throwable());
}
}
}