int (@NotNull PyFunction pyFunction, @NotNull Document document, int offset) { if (pyFunction.getContainingClass() != null) { final PyFunction.Modifier modifier = pyFunction.getModifier(); String parameterName = null; if (modifier == null) parameterName = PyNames.CANONICAL_SELF; else if (modifier == PyFunction.Modifier.CLASSMETHOD) parameterName = PyNames.CANONICAL_CLS; if (parameterName != null) { document.insertString(offset, parameterName); return offset + parameterName.length(); } } return offset; }