Search in sources :

Example 1 with GrClassTypeElement

use of org.jetbrains.plugins.groovy.lang.psi.api.types.GrClassTypeElement in project intellij-community by JetBrains.

the class GroovyPsiElementFactoryImpl method createReferenceElementFromText.

@NotNull
@Override
public GrCodeReferenceElement createReferenceElementFromText(@NotNull String refName, final PsiElement context) {
    GroovyFile file = createGroovyFileChecked("(" + refName + ")foo", false, context);
    GrTypeElement typeElement = ((GrTypeCastExpression) file.getTopStatements()[0]).getCastTypeElement();
    return ((GrClassTypeElement) typeElement).getReferenceElement();
}
Also used : GrTypeElement(org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement) GrClassTypeElement(org.jetbrains.plugins.groovy.lang.psi.api.types.GrClassTypeElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NotNull (org.jetbrains.annotations.NotNull)1 GrClassTypeElement (org.jetbrains.plugins.groovy.lang.psi.api.types.GrClassTypeElement)1 GrTypeElement (org.jetbrains.plugins.groovy.lang.psi.api.types.GrTypeElement)1