void (@NotNull RangeMarker bounds, @NotNull PsiFile psiFile, @NotNull PsiDocumentManager manager) { final PsiElement startElement = skipWhitespaces(psiFile.findElementAt(bounds.getStartOffset())); PsiElement propertyOrArrayItem = startElement instanceof JsonProperty ? startElement : getParentPropertyOrArrayItem(startElement); if (propertyOrArrayItem == null) return; PsiElement prevSibling = PsiTreeUtil.skipWhitespacesBackward(propertyOrArrayItem); if (prevSibling instanceof PsiErrorElement) { final int offset = prevSibling.getTextRange().getEndOffset(); ApplicationManager.getApplication().runWriteAction(() -> bounds.getDocument().insertString(offset, ",")); manager.commitDocument(bounds.getDocument()); } }