diff --git a/python/src/com/jetbrains/python/psi/resolve/CompletionVariantsProcessor.java b/python/src/com/jetbrains/python/psi/resolve/CompletionVariantsProcessor.java index 3e86952c9989..894fe51f622e 100644 --- a/python/src/com/jetbrains/python/psi/resolve/CompletionVariantsProcessor.java +++ b/python/src/com/jetbrains/python/psi/resolve/CompletionVariantsProcessor.java @@ -47,6 +47,7 @@ public class CompletionVariantsProcessor extends VariantsProcessor { if (!myPlainNamesOnly) { if (!mySuppressParentheses && object instanceof PyFunction && ((PyFunction)object).getProperty() == null && + hasNoCustomDecorators((PyFunction)object) && !isSingleArgDecoratorCall(myContext, (PyFunction)object)) { item = item.withInsertHandler(PyFunctionInsertHandler.INSTANCE); final PyParameterList parameterList = ((PyFunction)object).getParameterList(); @@ -102,6 +103,21 @@ public class CompletionVariantsProcessor extends VariantsProcessor { return item; } + private static boolean hasNoCustomDecorators(PyFunction function) { + PyDecoratorList decoratorList = function.getDecoratorList(); + if (decoratorList == null) { + return true; + } + for (PyDecorator decorator : decoratorList.getDecorators()) { + PyQualifiedName name = decorator.getQualifiedName(); + if (name == null || (!PyNames.CLASSMETHOD.equals(name.toString()) && !PyNames.STATICMETHOD.equals(name.toString()))) { + return false; + } + } + + return true; + } + private static boolean isSingleArgDecoratorCall(PsiElement elementInCall, PyFunction callee) { // special case hack to avoid the need of patching generator3.py PyClass containingClass = callee.getContainingClass();