瀏覽代碼

ENH: ctkPythonConsole: Ignores "self" parameter

This commit is based on commit 2cc22a7 originally associated with
topic python-autocomplete-parameter-detection from Christopher
Mullins.

It fixes issues reported in http://na-mic.org/Mantis/view.php?id=1227

Co-authored-by: Mayeul Chassagnard <mayeul.chassagnard@kitware.com>
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Christopher Mullins 8 年之前
父節點
當前提交
6c4055f1cc
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Libs/Scripting/Python/Widgets/ctkPythonConsole.cpp

+ 2 - 1
Libs/Scripting/Python/Widgets/ctkPythonConsole.cpp

@@ -143,7 +143,8 @@ int ctkPythonConsoleCompleter::cursorOffset(const QString& completion)
       }
     else if (this->isInUserDefinedClass(currentCompletionText))
       {
-      parameterCount = this->parameterCountUserDefinedClassFunction(QStringList(userDefinedFunctionPath+lineSplit).join("."));
+      // "self" parameter can be ignored
+      parameterCount = this->parameterCountUserDefinedClassFunction(QStringList(userDefinedFunctionPath+lineSplit).join(".")) - 1;
       }
     else
       {