Search in sources :

Example 1 with PerlImplicitSubDefinition

use of com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition in project Perl5-IDEA by Camelcade.

the class PerlImplicitDeclarationsService method registerAnonSub.

@NotNull
public PerlImplicitSubDefinition registerAnonSub(@NotNull String namespaceName, @NotNull String baseName, @Nullable PerlValue returnValue) {
    PerlImplicitSubDefinition subDefinition = new PerlImplicitSubDefinition(myPsiManager, baseName, namespaceName, Collections.emptyList(), returnValue, true);
    doRegister(mySubsMap, subDefinition);
    return subDefinition;
}
Also used : PerlImplicitSubDefinition(com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with PerlImplicitSubDefinition

use of com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition in project Perl5-IDEA by Camelcade.

the class PerlImplicitDeclarationsProvider method readSub.

private void readSub(@NotNull PerlImplicitDeclarationsService declarationsService, @NotNull String namespaceName, @NotNull Element element) {
    String subName = element.getAttributeValue(NAME);
    if (StringUtil.isEmpty(subName)) {
        LOG.warn("Missing or empty name attribute for sub");
        return;
    }
    PerlImplicitSubDefinition subDefinition;
    if (PerlPackageUtil.CORE_NAMESPACE.equals(namespaceName)) {
        subDefinition = new PerlBuiltInSubDefinition(declarationsService.getPsiManager(), subName, PerlPackageUtil.CORE_NAMESPACE, readArguments(element.getChild(ARGUMENTS_ELEMENT), subName));
    } else {
        subDefinition = new PerlImplicitSubDefinition(declarationsService.getPsiManager(), subName, namespaceName, readArguments(element.getChild(ARGUMENTS_ELEMENT), subName));
    }
    declarationsService.registerSub(subDefinition);
}
Also used : PerlImplicitSubDefinition(com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition) PerlBuiltInSubDefinition(com.perl5.lang.perl.psi.impl.PerlBuiltInSubDefinition)

Aggregations

PerlImplicitSubDefinition (com.perl5.lang.perl.psi.impl.PerlImplicitSubDefinition)2 PerlBuiltInSubDefinition (com.perl5.lang.perl.psi.impl.PerlBuiltInSubDefinition)1 NotNull (org.jetbrains.annotations.NotNull)1