Search in sources :

Example 26 with PsiShortNamesCache

use of com.intellij.psi.search.PsiShortNamesCache in project intellij-community by JetBrains.

the class CompositeShortNamesCache method getAllMethodNames.

@Override
@NotNull
public String[] getAllMethodNames() {
    Merger<String> merger = new Merger<>();
    for (PsiShortNamesCache cache : myCaches) {
        merger.add(cache.getAllMethodNames());
    }
    String[] result = merger.getResult();
    return result != null ? result : ArrayUtil.EMPTY_STRING_ARRAY;
}
Also used : PsiShortNamesCache(com.intellij.psi.search.PsiShortNamesCache) NotNull(org.jetbrains.annotations.NotNull)

Example 27 with PsiShortNamesCache

use of com.intellij.psi.search.PsiShortNamesCache in project intellij-community by JetBrains.

the class CompositeShortNamesCache method getFilesByName.

@Override
@NotNull
public PsiFile[] getFilesByName(@NotNull String name) {
    Merger<PsiFile> merger = null;
    for (PsiShortNamesCache cache : myCaches) {
        PsiFile[] classes = cache.getFilesByName(name);
        if (classes.length != 0) {
            if (merger == null)
                merger = new Merger<>();
            merger.add(classes);
        }
    }
    PsiFile[] result = merger == null ? null : merger.getResult();
    return result != null ? result : PsiFile.EMPTY_ARRAY;
}
Also used : PsiShortNamesCache(com.intellij.psi.search.PsiShortNamesCache) PsiFile(com.intellij.psi.PsiFile) NotNull(org.jetbrains.annotations.NotNull)

Example 28 with PsiShortNamesCache

use of com.intellij.psi.search.PsiShortNamesCache in project intellij-community by JetBrains.

the class CompositeShortNamesCache method getAllFieldNames.

@Override
@NotNull
public String[] getAllFieldNames() {
    Merger<String> merger = null;
    for (PsiShortNamesCache cache : myCaches) {
        String[] classes = cache.getAllFieldNames();
        if (classes.length != 0) {
            if (merger == null)
                merger = new Merger<>();
            merger.add(classes);
        }
    }
    String[] result = merger == null ? null : merger.getResult();
    return result == null ? ArrayUtil.EMPTY_STRING_ARRAY : result;
}
Also used : PsiShortNamesCache(com.intellij.psi.search.PsiShortNamesCache) NotNull(org.jetbrains.annotations.NotNull)

Example 29 with PsiShortNamesCache

use of com.intellij.psi.search.PsiShortNamesCache in project intellij-community by JetBrains.

the class CompositeShortNamesCache method getAllFileNames.

@Override
@NotNull
public String[] getAllFileNames() {
    Merger<String> merger = new Merger<>();
    for (PsiShortNamesCache cache : myCaches) {
        merger.add(cache.getAllFileNames());
    }
    String[] result = merger.getResult();
    return result != null ? result : ArrayUtil.EMPTY_STRING_ARRAY;
}
Also used : PsiShortNamesCache(com.intellij.psi.search.PsiShortNamesCache) NotNull(org.jetbrains.annotations.NotNull)

Example 30 with PsiShortNamesCache

use of com.intellij.psi.search.PsiShortNamesCache in project intellij-community by JetBrains.

the class CompositeShortNamesCache method getFieldsByNameIfNotMoreThan.

@NotNull
@Override
public PsiField[] getFieldsByNameIfNotMoreThan(@NonNls @NotNull String name, @NotNull GlobalSearchScope scope, int maxCount) {
    Merger<PsiField> merger = null;
    for (PsiShortNamesCache cache : myCaches) {
        PsiField[] fields = cache.getFieldsByNameIfNotMoreThan(name, scope, maxCount);
        if (fields.length == maxCount)
            return fields;
        if (fields.length != 0) {
            if (merger == null)
                merger = new Merger<>();
            merger.add(fields);
        }
    }
    PsiField[] result = merger == null ? null : merger.getResult();
    return result == null ? PsiField.EMPTY_ARRAY : result;
}
Also used : PsiShortNamesCache(com.intellij.psi.search.PsiShortNamesCache) PsiField(com.intellij.psi.PsiField) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiShortNamesCache (com.intellij.psi.search.PsiShortNamesCache)30 NotNull (org.jetbrains.annotations.NotNull)20 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)11 Project (com.intellij.openapi.project.Project)6 PsiClass (com.intellij.psi.PsiClass)5 ArrayList (java.util.ArrayList)4 Nullable (org.jetbrains.annotations.Nullable)4 com.intellij.psi (com.intellij.psi)3 Processor (com.intellij.util.Processor)3 HashSet (com.intellij.util.containers.HashSet)3 Module (com.intellij.openapi.module.Module)2 PsiField (com.intellij.psi.PsiField)2 PsiMethod (com.intellij.psi.PsiMethod)2 THashSet (gnu.trove.THashSet)2 List (java.util.List)2 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2 HighlightInfo (com.intellij.codeInsight.daemon.impl.HighlightInfo)1 NodeIterator (com.intellij.dupLocator.iterators.NodeIterator)1 DefaultPsiElementCellRenderer (com.intellij.ide.util.DefaultPsiElementCellRenderer)1