Pycharm Plugin add DocString to Python Function
Hello,
i want to add a DocString to a python function via plugin. If the function has a DocString I ca do it by
"\"\"\"" + "test123"+ "\"\"\"");pyFunction.getDocStringExpression();
docStringExpression.replace(docstring);
but I don't know how to add the DocString if
docStringExpression == null
what would be the best way to do it?
Please sign in to leave a comment.
PyStatementList statementList = element.getStatementList();
statementList.addBefore(docstring, statementList.getStatements()[0]);
Works Great! Thank You!