void (@NotNull XDebugSession session, InlineDebugRenderer renderer) { EDT.assertIsEdt(); XSourcePosition position = renderer.getPosition(); FileEditor editor = XDebuggerUtil.getInstance().getSelectedEditor(session.getProject(), position.getFile()); if (editor instanceof TextEditor) { Editor e = ((TextEditor)editor).getEditor(); int line = position.getLine(); if (!DocumentUtil.isValidLine(line, e.getDocument())) return; int lineStart = e.getDocument().getLineStartOffset(line); int lineEnd = e.getDocument().getLineEndOffset(line); // Don't add the same value twice. List<Inlay<? extends InlineDebugRenderer>> existingInlays = e.getInlayModel().getAfterLineEndElementsInRange(lineStart, lineEnd, InlineDebugRenderer.class); if (ContainerUtil.exists(existingInlays, i -> i.getRenderer().getValueNode().equals(renderer.getValueNode()))) { return; } Inlay<InlineDebugRenderer> inlay = e.getInlayModel().addAfterLineEndElement(lineEnd, new InlayProperties() .disableSoftWrapping(true) .priority(renderer.isCustomNode() ? 0 : -1), renderer); if (inlay == null) { return; } XValueNodeImpl valueNode = renderer.getValueNode(); valueNode.getTree().addTreeListener(new XDebuggerTreeListener() { @Override public void nodeLoaded(@NotNull RestorableStateNode node, @NotNull String name) { if (node == valueNode) { renderer.updatePresentation(); inlay.update(); } } }, inlay); if (renderer.isCustomNode()) { ((InlineWatchNodeImpl)valueNode).inlayCreated(inlay); } } }