PsiType (@NotNull GrExpression qualifier, @Nullable PsiElement resolve, @NotNull final String key) { Pair<ConfigSlurperSupport.PropertiesProvider, List<String>> info = getInfo(qualifier, resolve); if (info == null) return null; final Ref<Boolean> res = new Ref<>(); info.first.collectVariants(info.second, (variant, isFinal) -> { if (variant.equals(key)) { res.set(isFinal); } else if (variant.startsWith(key) && variant.length() > key.length() && variant.charAt(key.length()) == '.') { res.set(false); } }); if (res.get() != null && !res.get()) { return JavaPsiFacade.getElementFactory(qualifier.getProject()).createTypeByFQClassName(GroovyCommonClassNames.GROOVY_UTIL_CONFIG_OBJECT, qualifier.getResolveScope()); } return null; }