Search in sources :

Example 1 with PerlNamespaceElementImpl

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

the class PerlElementFactory method createPackageName.

// fixme probably we don't need package name and sub. just identifier
public static PerlNamespaceElementImpl createPackageName(Project project, String name) {
    PerlFileImpl file = createFile(project, "package " + name + ";");
    PerlNamespaceDefinitionMixin def = PsiTreeUtil.findChildOfType(file, PerlNamespaceDefinitionMixin.class);
    assert def != null;
    return (PerlNamespaceElementImpl) def.getNamespaceElement();
}
Also used : PerlNamespaceElementImpl(com.perl5.lang.perl.psi.impl.PerlNamespaceElementImpl) PerlFileImpl(com.perl5.lang.perl.psi.impl.PerlFileImpl) PerlNamespaceDefinitionMixin(com.perl5.lang.perl.psi.mixins.PerlNamespaceDefinitionMixin)

Aggregations

PerlFileImpl (com.perl5.lang.perl.psi.impl.PerlFileImpl)1 PerlNamespaceElementImpl (com.perl5.lang.perl.psi.impl.PerlNamespaceElementImpl)1 PerlNamespaceDefinitionMixin (com.perl5.lang.perl.psi.mixins.PerlNamespaceDefinitionMixin)1