private @NotNull List<PySmartStepIntoVariant> findVariants(@NotNull XSourcePosition position) {
    ThreadingAssertions.assertBackgroundThread();

    PyStackFrame currentFrame = (PyStackFrame)mySession.getCurrentStackFrame();
    if (currentFrame == null || currentFrame.isComprehension()) return Collections.emptyList();

    PySmartStepIntoContext context = ReadAction.compute(() -> createSmartStepIntoContext(currentFrame));
    if (context == null) return Collections.emptyList();

    var document = ReadAction.compute(() -> FileDocumentManager.getInstance().getDocument(position.getFile()));
    if (document == null) return Collections.emptyList();

    var variantsFromPython = myProcess.getSmartStepIntoVariants(context.getStartLine(), context.getEndLine());

    if (variantsFromPython.isEmpty()) return Collections.emptyList();

    return ReadAction.compute(() -> removePossiblyUnreachableVariants(document, position.getLine(), variantsFromPython, context));
  }
private @NotNull List<PySmartStepIntoVariant> findVariants(@NotNull XSourcePosition position)