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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations