PsiClassType (@NotNull GroovyScriptClass scriptClass) { //Groovy BaseScriptASTTransformation works exactly with this priorities PsiClassType fromVariable = getSuperClassTypeFromBaseScriptAnnotatedVariable(scriptClass); if (fromVariable != null) { return fromVariable; } PsiClassType fromImport = getSuperClassTypeFromBaseScriptAnnotatedImportDefinition(scriptClass); if (fromImport != null) { return fromImport; } return getSuperClassTypeFromBaseScriptAnnotatedPackageDefinition(scriptClass); }