void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getStartElement(); final PsiFile file = element.getContainingFile(); final Property property = PsiTreeUtil.getParentOfType(element, Property.class); LOG.assertTrue(property != null); final int start = property.getTextRange().getStartOffset(); @NonNls final Document doc = PsiDocumentManager.getInstance(project).getDocument(file); LOG.assertTrue(doc != null); final int line = doc.getLineNumber(start); final int lineStart = doc.getLineStartOffset(line); doc.insertString(lineStart, "# suppress inspection \"" + shortName + "\"\n"); }