public abstract class CompilerReferenceServiceBase<Reader extends CompilerReferenceReader<?>> extends java.lang.Object implements CompilerReferenceService, ModificationTracker
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CompilerReferenceServiceBase.CompilerElementInfo |
protected static class |
CompilerReferenceServiceBase.ElementPlace |
protected static class |
CompilerReferenceServiceBase.HierarchySearchKey |
protected static class |
CompilerReferenceServiceBase.IndexCloseReason |
protected static class |
CompilerReferenceServiceBase.IndexOpenReason |
protected static interface |
CompilerReferenceServiceBase.ReferentFileSearcher |
protected static class |
CompilerReferenceServiceBase.ScopeWithoutReferencesOnCompilation |
| Modifier and Type | Field and Description |
|---|---|
protected int |
myActiveBuilds |
protected java.util.concurrent.atomic.LongAdder |
myCompilationCount |
protected DirtyScopeHolder |
myDirtyScopeHolder |
protected java.util.Set<FileType> |
myFileTypes |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
myLock |
protected java.util.concurrent.locks.Lock |
myOpenCloseLock |
protected Project |
myProject |
protected ProjectFileIndex |
myProjectFileIndex |
protected java.util.concurrent.locks.Lock |
myReadDataLock |
protected Reader |
myReader |
protected CompilerReferenceReaderFactory<? extends Reader> |
myReaderFactory |
IS_ENABLED_KEYEVER_CHANGED, NEVER_CHANGED| Constructor and Description |
|---|
CompilerReferenceServiceBase(Project project,
CompilerReferenceReaderFactory<? extends Reader> readerFactory,
java.util.function.BiConsumer<MessageBusConnection,java.util.Set<java.lang.String>> compilationAffectedModulesSubscription) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInstance, isEnabledprojectCloseddisposeComponent, initComponentgetComponentNameprotected final java.util.Set<FileType> myFileTypes
protected final DirtyScopeHolder myDirtyScopeHolder
protected final ProjectFileIndex myProjectFileIndex
protected final java.util.concurrent.atomic.LongAdder myCompilationCount
protected final java.util.concurrent.locks.ReentrantReadWriteLock myLock
protected final java.util.concurrent.locks.Lock myReadDataLock
protected final java.util.concurrent.locks.Lock myOpenCloseLock
protected final Project myProject
protected final CompilerReferenceReaderFactory<? extends Reader extends CompilerReferenceReader<?>> myReaderFactory
protected int myActiveBuilds
protected volatile Reader extends CompilerReferenceReader<?> myReader
public CompilerReferenceServiceBase(Project project, CompilerReferenceReaderFactory<? extends Reader> readerFactory, java.util.function.BiConsumer<MessageBusConnection,java.util.Set<java.lang.String>> compilationAffectedModulesSubscription)
public void projectOpened()
ProjectComponentNote that components may be created for even unopened projects and this method can be never invoked for a particular component instance (for example for default project).
projectOpened in interface ProjectComponentpublic GlobalSearchScope getScopeWithoutCodeReferences(PsiElement element)
getScopeWithoutCodeReferences in interface CompilerReferenceServicepublic GlobalSearchScope getScopeWithoutImplicitToStringCodeReferences(PsiElement aClass)
getScopeWithoutImplicitToStringCodeReferences in interface CompilerReferenceServicepublic CompilerDirectHierarchyInfo getDirectInheritors(PsiNamedElement aClass, GlobalSearchScope searchScope, FileType searchFileType)
getDirectInheritors in interface CompilerReferenceServicepublic CompilerDirectHierarchyInfo getFunExpressions(PsiNamedElement functionalInterface, GlobalSearchScope searchScope, FileType searchFileType)
getFunExpressions in interface CompilerReferenceServicepublic java.lang.Integer getCompileTimeOccurrenceCount(PsiElement element, boolean isConstructorSuggestion)
getCompileTimeOccurrenceCount in interface CompilerReferenceServiceprotected java.lang.Integer calculateOccurrenceCount(PsiElement element, boolean isConstructorSuggestion)
protected com.intellij.compiler.backwardRefs.CompilerHierarchyInfoImpl getHierarchyInfo(PsiNamedElement aClass, GlobalSearchScope searchScope, FileType searchFileType, CompilerHierarchySearchType searchType)
protected boolean isServiceEnabledFor(PsiElement element)
public boolean isActive()
isActive in interface CompilerReferenceServiceprotected java.util.Map<VirtualFile,SearchId[]> calculateDirectInheritors(PsiNamedElement aClass, FileType searchFileType, CompilerHierarchySearchType searchType)
protected GlobalSearchScope buildScopeWithoutReferences(TIntHashSet referentFileIds)
protected TIntHashSet getReferentFileIds(PsiElement element)
protected TIntHashSet getReferentFileIdsViaImplicitToString(PsiElement element)
protected TIntHashSet getReferentFileIds(PsiElement element, boolean buildHierarchyForLibraryElements, CompilerReferenceServiceBase.ReferentFileSearcher referentFileSearcher)
protected CompilerReferenceServiceBase.CompilerElementInfo asCompilerElements(PsiElement psiElement, boolean buildHierarchyForLibraryElements, boolean checkNotDirty)
protected void closeReaderIfNeeded(CompilerReferenceServiceBase.IndexCloseReason reason)
protected void openReaderIfNeeded(CompilerReferenceServiceBase.IndexOpenReason reason)
protected void markAsOutdated(boolean decrementBuildCount)
public ProjectFileIndex getFileIndex()
public java.util.Set<FileType> getFileTypes()
public Project getProject()
protected static void executeOnBuildThread(java.lang.Runnable compilationFinished)
public long getModificationCount()
getModificationCount in interface ModificationTrackerpublic java.util.Set<VirtualFile> getReferentFiles(PsiElement element)
public java.util.Set<Module> getAllDirtyModulesForTest()
public CompilerReferenceFindUsagesTestInfo getTestFindUsages(PsiElement element)
public CompilerReferenceHierarchyTestInfo getTestHierarchy(PsiNamedElement element, GlobalSearchScope scope, FileType fileType)
public CompilerReferenceHierarchyTestInfo getTestFunExpressions(PsiNamedElement element, GlobalSearchScope scope, FileType fileType)
protected <T> T onException(java.lang.Exception e,
java.lang.String actionName)
protected static TIntHashSet intersection(TIntHashSet set1,
TIntHashSet set2)
protected static boolean requireIndexRebuild(java.lang.Throwable exception)