int (@NotNull Editor editor, @NotNull PsiFile file) { int offsetFromBraceMatcher = calcBlockStartOffsetFromBraceMatcher(editor, file); TextRange rangeFromStructuralSupport = CodeBlockSupportHandler.findCodeBlockRange(editor, file); if (rangeFromStructuralSupport.isEmpty()) { return offsetFromBraceMatcher; } else if (offsetFromBraceMatcher == -1) { return rangeFromStructuralSupport.getStartOffset(); } else { return Math.max(rangeFromStructuralSupport.getStartOffset(), offsetFromBraceMatcher); } }