package fr.adrienbrault.idea.symfony2plugin.stubs.util;

import com.intellij.util.indexing.FileBasedIndexImpl;
import com.intellij.util.indexing.ID;
import fr.adrienbrault.idea.symfony2plugin.stubs.indexes.*;

public class IndexUtil {

    public static void forceReindex() {

        ID<?,?>[] indexIds = new ID<?,?>[] {
            ServicesDefinitionStubIndex.KEY,
            AnnotationRoutesStubIndex.KEY,
            ContainerParameterStubIndex.KEY,
            ServicesTagStubIndex.KEY,
            TwigExtendsStubIndex.KEY,
            TwigIncludeStubIndex.KEY,
            TwigMacroFromStubIndex.KEY,
            TwigMacroFunctionStubIndex.KEY,
            RoutesStubIndex.KEY,
            YamlTranslationStubIndex.KEY,
            DoctrineMetadataFileStubIndex.KEY,
            FileResourcesIndex.KEY,
        };

        for(ID<?,?> id: indexIds) {
            FileBasedIndexImpl.getInstance().requestRebuild(id);
            FileBasedIndexImpl.getInstance().scheduleRebuild(id, new Throwable());
        }

    }

}

@@ -331,26 +331,159 @@
     
-ServicesDefinition
+AnnotationRoutesStubIndex.KEY,%0A            ContainerBuilderStubIndex.KEY,%0A            ContainerParameterStubIndex.KEY,%0A            DoctrineMetadataFile
 Stub
@@ -497,32 +497,37 @@
 EY,%0A            
+Event
 AnnotationRoutes
@@ -524,59 +524,169 @@
 tion
-RoutesStubIndex.KEY,%0A            ContainerParameter
+StubIndex.KEY,%0A            FileResourcesIndex.KEY,%0A            PhpTwigTemplateUsageStubIndex.KEY,%0A            RoutesStubIndex.KEY,%0A            ServicesDefinition
 Stub
@@ -910,143 +910,27 @@
     
-RoutesStubIndex.KEY,%0A            YamlTranslationStubIndex.KEY,%0A            DoctrineMetadataFileStubIndex.KEY,%0A            FileResources
+YamlTranslationStub
 Inde

add new indexes and reorder cleanup array