use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlElementFactory method createString.
public static PerlString createString(Project project, String code) {
PerlFileImpl file = createFile(project, code + ";");
PerlString string = PsiTreeUtil.findChildOfType(file, PerlString.class);
assert string != null : "While creating bare string from: " + code;
return string;
}
use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlElementFactory method createMethodCall.
public static PsiPerlDerefExpr createMethodCall(Project project, String packageName, String subName) {
assert packageName != null;
assert subName != null;
PerlFileImpl file = createFile(project, String.format("%s->%s;", packageName, subName));
PsiPerlDerefExpr def = PsiTreeUtil.findChildOfType(file, PsiPerlDerefExpr.class);
assert def != null;
return def;
}
use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlElementFactory method createDereference.
public static PsiElement createDereference(Project project) {
PerlFileImpl file = createFile(project, "$a->{bla};");
PerlVariable variable = PsiTreeUtil.findChildOfType(file, PerlVariable.class);
assert variable != null : "While creating dereference";
return variable.getNextSibling();
}
use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlElementFactory method createStringContent.
public static PerlStringContentElementImpl createStringContent(Project project, String name) {
PerlFileImpl file = createFile(project, "'" + name + "';");
PsiPerlStringSq string = PsiTreeUtil.findChildOfType(file, PsiPerlStringSq.class);
assert string != null;
return (PerlStringContentElementImpl) string.getFirstChild().getNextSibling();
}
use of com.perl5.lang.perl.psi.impl.PerlFileImpl in project Perl5-IDEA by Camelcade.
the class PerlElementFactory method createParenthesisedExpression.
public static PsiPerlParenthesisedExpr createParenthesisedExpression(Project project) {
PerlFileImpl file = createFile(project, "();");
PsiPerlParenthesisedExpr result = PsiTreeUtil.findChildOfType(file, PsiPerlParenthesisedExpr.class);
assert result != null : "While creating PsiPerlParenthesisedExpr";
return result;
}
Aggregations