List<PySmartStepIntoVariant> (@NotNull XSourcePosition position) { PyStackFrame currentFrame = (PyStackFrame)mySession.getCurrentStackFrame(); if (currentFrame == null || currentFrame.isComprehension()) return Collections.emptyList(); PySmartStepIntoContext context = createSmartStepIntoContext(currentFrame); if (context == null) return Collections.emptyList(); final Document document = FileDocumentManager.getInstance().getDocument(position.getFile()); if (document == null) return Collections.emptyList(); Future<List<Pair<String, Boolean>>> future = ApplicationManager.getApplication().executeOnPooledThread( () -> myProcess.getSmartStepIntoVariants(context.getStartLine(), context.getEndLine())); List<Pair<String, Boolean>> variantsFromPython; try { variantsFromPython = future.get(); } catch (InterruptedException | ExecutionException e) { return Collections.emptyList(); } if (variantsFromPython.size() == 0) return Collections.emptyList(); return removePossiblyUnreachableVariants(document, position.getLine(), variantsFromPython, context); }