boolean (@NotNull PsiElement element) { if (element.getLanguage() != GroovyLanguage.INSTANCE) return false; if (!CodeStyleSettingsManager.getInstance(element.getProject()).getCurrentSettings() .getCustomSettings(GroovyCodeStyleSettings.class).USE_FLYING_GEESE_BRACES) { return false; } if (PsiImplUtil.isWhiteSpaceOrNls(element)) { element = PsiTreeUtil.prevLeaf(element); } if (!GeeseUtil.isClosureRBrace(element) || !GeeseUtil.isClosureContainLF(element)) return false; TextRange range = findRange(element); return StringUtil.contains(element.getContainingFile().getText(), range.getStartOffset(), range.getEndOffset(), '\n'); }