use of com.perl5.lang.perl.parser.Class.Accessor.ClassAccessorElementTypes.CLASS_ACCESSOR_METHOD in project Perl5-IDEA by Camelcade.
the class PerlClassAccessorHandler method computeLightElementsFromPsi.
@Override
@NotNull
public List<? extends PerlDelegatingLightNamedElement<?>> computeLightElementsFromPsi(@NotNull PerlSubCallElement psiElement) {
String packageName = PerlPackageUtil.getContextNamespaceName(psiElement);
if (StringUtil.isEmpty(packageName)) {
return Collections.emptyList();
}
List<PsiElement> listElements = psiElement.getCallArgumentsList();
if (listElements.isEmpty()) {
return Collections.emptyList();
}
List<PerlDelegatingLightNamedElement<?>> result = new ArrayList<>();
for (PsiElement listElement : listElements) {
if (!psiElement.isAcceptableIdentifierElement(listElement)) {
continue;
}
String baseName = ElementManipulators.getValueText(listElement);
PerlSubAnnotations subAnnotations = PerlSubAnnotations.computeForLightElement(psiElement, listElement);
for (Function<String, String> computation : getNamesComputations(psiElement)) {
result.add(new PerlClassAccessorMethod(psiElement, baseName, computation, CLASS_ACCESSOR_METHOD, listElement, packageName, subAnnotations));
}
}
return result;
}
use of com.perl5.lang.perl.parser.Class.Accessor.ClassAccessorElementTypes.CLASS_ACCESSOR_METHOD in project Perl5-IDEA by Camelcade.
the class PerlClassAccessorWrapper method calcLightElementsFromPsi.
@NotNull
@Override
public List<PerlDelegatingLightNamedElement> calcLightElementsFromPsi() {
String packageName = PerlPackageUtil.getContextPackageName(this);
if (StringUtil.isEmpty(packageName)) {
return Collections.emptyList();
}
List<PsiElement> listElements = getCallArgumentsList();
if (listElements.isEmpty()) {
return Collections.emptyList();
}
List<PerlDelegatingLightNamedElement> result = new ArrayList<>();
for (PsiElement listElement : listElements) {
if (!isAcceptableIdentifierElement(listElement)) {
continue;
}
String baseName = ElementManipulators.getValueText(listElement);
PerlSubAnnotations subAnnotations = computeSubAnnotations(this, listElement);
for (Function<String, String> computation : getNamesComputations()) {
result.add(new PerlClassAccessorMethod(this, baseName, computation, CLASS_ACCESSOR_METHOD, listElement, packageName, subAnnotations));
}
}
return result;
}
Aggregations