use of com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceOwner in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoPsiImplUtil method resolve.
@Nullable
public static PsiDirectory resolve(@NotNull GoImportString importString) {
PsiReference[] references = importString.getReferences();
for (PsiReference reference : references) {
if (reference instanceof FileReferenceOwner) {
PsiFileReference lastFileReference = ((FileReferenceOwner) reference).getLastFileReference();
PsiElement result = lastFileReference != null ? lastFileReference.resolve() : null;
return result instanceof PsiDirectory ? (PsiDirectory) result : null;
}
}
return null;
}
Aggregations