void (StackFrameContext context) { ApplicationManager.getApplication().runReadAction(() -> { if (context.getFrameProxy() != null) { SourcePosition sourcePosition = PositionUtil.getSourcePosition(context); int offset = sourcePosition.getOffset(); Document document = PsiDocumentManager.getInstance(myProject).getDocument(sourcePosition.getFile()); CharSequence text = Objects.requireNonNull(document).getImmutableCharSequence(); String positionText = ""; if (offset > -1) { CharSequence before = text.subSequence(Math.max(0, offset - 20), offset); CharSequence after = text.subSequence(offset, Math.min(offset + 20, text.length())); positionText = StringUtil.escapeLineBreak(" [" + before + "<*>" + after + "]"); } systemPrintln(toDisplayableString(sourcePosition) + positionText); printHighlightingRange((SuspendContextImpl)context); } else { systemPrintln("Context thread is null"); } }); }