use of org.ballerinalang.plugins.idea.psi.PackageNameNode in project ballerina by ballerina-lang.
the class StructReference method resolve.
@Nullable
@Override
public PsiElement resolve() {
IdentifierPSINode identifier = getElement();
PsiElement parent = identifier.getParent();
PackageNameNode packageNameNode = PsiTreeUtil.getChildOfType(parent, PackageNameNode.class);
if (packageNameNode == null) {
return resolveInCurrentPackage();
} else {
return resolveInPackage(packageNameNode);
}
}
use of org.ballerinalang.plugins.idea.psi.PackageNameNode in project ballerina by ballerina-lang.
the class StructReference method getVariants.
@NotNull
@Override
public Object[] getVariants() {
List<LookupElement> results = new LinkedList<>();
IdentifierPSINode identifier = getElement();
PsiElement parent = identifier.getParent();
PackageNameNode packageNameNode = PsiTreeUtil.getChildOfType(parent, PackageNameNode.class);
if (packageNameNode == null) {
results.addAll(getVariantsFromCurrentPackage());
} else {
results.addAll(getVariantsFromPackage(packageNameNode));
}
return results.toArray(new LookupElement[results.size()]);
}
use of org.ballerinalang.plugins.idea.psi.PackageNameNode in project ballerina by ballerina-lang.
the class AnnotationReference method resolve.
@Nullable
@Override
public PsiElement resolve() {
IdentifierPSINode identifier = getElement();
PsiElement parent = identifier.getParent();
PackageNameNode packageNameNode = PsiTreeUtil.getChildOfType(parent, PackageNameNode.class);
if (packageNameNode == null) {
return resolveInCurrentPackage();
} else {
return resolveInPackage(packageNameNode);
}
}
use of org.ballerinalang.plugins.idea.psi.PackageNameNode in project ballerina by ballerina-lang.
the class ConnectorReference method resolve.
@Nullable
@Override
public PsiElement resolve() {
IdentifierPSINode identifier = getElement();
PsiElement parent = identifier.getParent();
PackageNameNode packageNameNode = PsiTreeUtil.getChildOfType(parent, PackageNameNode.class);
if (packageNameNode == null) {
return resolveInCurrentPackage(identifier);
} else {
return resolveInPackage(packageNameNode, identifier);
}
}
use of org.ballerinalang.plugins.idea.psi.PackageNameNode in project ballerina by ballerina-lang.
the class ConnectorReference method getVariants.
@NotNull
@Override
public Object[] getVariants() {
List<LookupElement> results = new LinkedList<>();
IdentifierPSINode identifier = getElement();
PsiElement parent = identifier.getParent();
PackageNameNode packageNameNode = PsiTreeUtil.getChildOfType(parent, PackageNameNode.class);
if (packageNameNode == null) {
results.addAll(getVariantsInCurrentPackage());
} else {
results.addAll(getVariantsInPackage(packageNameNode));
}
return results.toArray(new LookupElement[results.size()]);
}
Aggregations