use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlPackageCompletionUtil method fillWithPackageNameSuggestions.
public static void fillWithPackageNameSuggestions(@NotNull PsiElement element, @NotNull final CompletionResultSet result) {
PsiFile file = element.getContainingFile().getOriginalFile();
VirtualFile virtualFile = file.getViewProvider().getVirtualFile();
if (virtualFile.getFileType() == PerlFileTypePackage.INSTANCE) {
result.addElement(LookupElementBuilder.create(virtualFile.getNameWithoutExtension()));
if (file instanceof PerlFileImpl) {
String packageName = ((PerlFileImpl) file).getFilePackageName();
if (packageName != null) {
result.addElement(LookupElementBuilder.create(packageName));
}
}
}
}
use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlNamespaceElementImpl method getNamespaceFiles.
@Override
public List<PerlFileImpl> getNamespaceFiles() {
List<PerlFileImpl> namespaceFiles = new ArrayList<>();
PsiReference[] references = getReferences();
for (PsiReference reference : references) {
if (reference instanceof PerlNamespaceFileReference) {
ResolveResult[] results = ((PerlNamespaceFileReference) reference).multiResolve(false);
for (ResolveResult result : results) {
PsiElement targetElement = result.getElement();
assert targetElement != null;
if (targetElement instanceof PerlFileImpl) {
namespaceFiles.add((PerlFileImpl) targetElement);
}
}
}
}
return namespaceFiles;
}
Aggregations