mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-18733 Consider return type collected by debugger in generated docstrings
Don't add empty type annotation for return value inside generated docstring unconditionally in PyDocstringGenerator. It should really be found in PyDocstringGenerator#prepareParameters().
This commit is contained in:
@@ -209,10 +209,7 @@ public class PyDocstringGenerator {
|
||||
statementList.accept(visitor);
|
||||
if (!isConstructor((PyFunction)myDocStringOwner) && (visitor.myHasReturn || addReturn)) {
|
||||
// will add :return: placeholder in Sphinx/Epydoc docstrings
|
||||
myAddedParams.add(new DocstringParam("", null, true));
|
||||
if (PyCodeInsightSettings.getInstance().INSERT_TYPE_DOCSTUB) {
|
||||
withReturnValue("");
|
||||
}
|
||||
withReturnValue(null);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
@@ -274,7 +271,8 @@ public class PyDocstringGenerator {
|
||||
String type = paramTypes.get(paramCoordinates);
|
||||
if (type == null && PyCodeInsightSettings.getInstance().INSERT_TYPE_DOCSTUB) {
|
||||
if (signature != null) {
|
||||
type = StringUtil.notNullize(param.isReturnValue() ? signature.getReturnTypeQualifiedName() :
|
||||
type = StringUtil.notNullize(param.isReturnValue() ?
|
||||
signature.getReturnTypeQualifiedName() :
|
||||
signature.getArgTypeQualifiedName(param.getName()));
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user