List<JavaBreakpointVariant> (@NotNull Project project, @NotNull XSourcePosition position) { PsiFile file = DebuggerUtilsEx.getPsiFile(position, project); if (file == null) return Collections.emptyList(); SourcePosition pos = SourcePosition.createFromLine(file, position.getLine()); Document document = file.getViewProvider().getDocument(); if (document == null) { return Collections.emptyList(); } PsiElement startMethod = DebuggerUtilsEx.getContainingMethod(pos); List<PsiLambdaExpression> lambdas = DebuggerUtilsEx.collectLambdas(pos, true); PsiElement condRet = canStopOnConditionalReturn(file) ? findSingleConditionalReturn(project, document, position.getLine()) : null; if ((lambdas.isEmpty() || (lambdas.contains(startMethod) && lambdas.size() == 1)) && condRet == null) { return Collections.emptyList(); } List<JavaBreakpointVariant> res = new SmartList<>(); int lambdaCount = 0; if (!(startMethod instanceof PsiLambdaExpression)) { res.add(new LineJavaBreakpointVariant(position, startMethod, -1)); } { int ordinal = 0; for (PsiLambdaExpression lambda : lambdas) { //lambdas PsiElement firstElem = DebuggerUtilsEx.getFirstElementOnTheLine(lambda, document, position.getLine()); XSourcePositionImpl elementPosition = XSourcePositionImpl.createByElement(firstElem); if (elementPosition != null) { if (lambda == startMethod) { res.add(0, new LineJavaBreakpointVariant(elementPosition, lambda, ordinal++)); } else { lambdaCount++; res.add(new LambdaJavaBreakpointVariant(elementPosition, lambda, ordinal++)); } } } } if (lambdaCount > 0) { res.add(new JavaBreakpointVariant(position, lambdaCount)); //all } if (condRet != null) { PsiElement method = DebuggerUtilsEx.getContainingMethod(condRet); int ordinal = lambdas.indexOf(method); res.add(new ConditionalReturnJavaBreakpointVariant(position, condRet, ordinal)); //conditional return } return res; }