diff --git a/python/src/com/jetbrains/python/codeInsight/intentions/PyGenerateDocstringIntention.java b/python/src/com/jetbrains/python/codeInsight/intentions/PyGenerateDocstringIntention.java index 7acfc9716fea..ca7ec65f9908 100644 --- a/python/src/com/jetbrains/python/codeInsight/intentions/PyGenerateDocstringIntention.java +++ b/python/src/com/jetbrains/python/codeInsight/intentions/PyGenerateDocstringIntention.java @@ -69,6 +69,7 @@ public class PyGenerateDocstringIntention extends BaseIntentionAction { if (function == null || statementList != null) { return false; } + if (!elementAt.equals(function.getNameNode())) return false; return isAvailableForFunction(project, function); }