use of com.intellij.psi.PsiElementResolveResult in project Perl5-IDEA by Camelcade.
the class PerlMooseInnerReference method collectNamespaceMethodsAugmentations.
protected void collectNamespaceMethodsAugmentations(@NotNull PerlNamespaceDefinitionElement namespaceDefinition, @NotNull String subName, Set<PerlNamespaceDefinitionElement> recursionSet, List<ResolveResult> result) {
recursionSet.add(namespaceDefinition);
for (PerlNamespaceDefinitionElement childNamespace : namespaceDefinition.getChildNamespaceDefinitions()) {
if (!recursionSet.contains(childNamespace)) {
boolean noSubclasses = false;
for (PsiElement augmentStatement : getAugmentStatements(childNamespace)) {
if (subName.equals(((PerlMooseAugmentStatement) augmentStatement).getSubName())) {
result.add(new PsiElementResolveResult(augmentStatement));
noSubclasses = true;
}
}
if (!noSubclasses) {
collectNamespaceMethodsAugmentations(childNamespace, subName, recursionSet, result);
}
}
}
}
use of com.intellij.psi.PsiElementResolveResult in project intellij by bazelbuild.
the class GlobReference method resolveInner.
@Override
protected ResolveResult[] resolveInner(boolean incompleteCode, PsiFile containingFile) {
File containingDirectory = ((BuildFile) containingFile).getFile().getParentFile();
if (containingDirectory == null) {
return ResolveResult.EMPTY_ARRAY;
}
List<String> includes = resolveListContents(element.getIncludes());
List<String> excludes = resolveListContents(element.getExcludes());
boolean directoriesExcluded = element.areDirectoriesExcluded();
if (includes.isEmpty()) {
return ResolveResult.EMPTY_ARRAY;
}
Project project = element.getProject();
try {
List<File> files = UnixGlob.forPath(containingDirectory).addPatterns(includes).addExcludes(excludes).setExcludeDirectories(directoriesExcluded).setDirectoryFilter(directoryFilter(project, containingDirectory.getPath())).glob();
List<ResolveResult> results = Lists.newArrayListWithCapacity(files.size());
for (File file : files) {
PsiFileSystemItem psiFile = BuildReferenceManager.getInstance(project).resolveFile(file);
if (psiFile != null) {
results.add(new PsiElementResolveResult(psiFile));
}
}
return results.toArray(ResolveResult.EMPTY_ARRAY);
} catch (Exception e) {
return ResolveResult.EMPTY_ARRAY;
}
}
Aggregations