Ali Gholami Rudi  committed 98b0038

findit: added maxfixes argument to find_definition()

  • Participants
  • Parent commits 38d4f41
  • Branches trunk

Comments (0)

Files changed (1)

File rope/contrib/

     return _find_locations(finder, resources, job_set)
-def find_definition(project, code, offset, resource=None):
+def find_definition(project, code, offset, resource=None, maxfixes=1):
     """Return the definition location of the python name at `offset`
     A `Location` object is returned if the definition location can be
     import rope.contrib.codeassist
     main_module = rope.contrib.codeassist._get_pymodule(
-        project.pycore, code, resource, 0)
+        project.pycore, code, resource, maxfixes)
     pyname = rope.contrib.codeassist._find_pyname_at(
-        project, code, offset, main_module, 0)
+        project, code, offset, main_module, maxfixes)
     if pyname is not None:
         module, lineno = pyname.get_definition_location()
         name = rope.base.worder.Worder(code).get_word_at(offset)