Commits

Anonymous committed 8cb675b

findit: fixed finding definitions in other modules

Patch by: Joe Ranieri <joe@alacatialabs.com>

  • Participants
  • Parent commits b1573ad

Comments (0)

Files changed (1)

rope/contrib/findit.py

         module, lineno = pyname.get_definition_location()
         name = rope.base.worder.Worder(code).get_word_at(offset)
         if lineno is not None:
-            start = pymodule.lines.get_line_start(lineno)
+            start = module.lines.get_line_start(lineno)
             def myfilter(occurrence):
                 if occurrence.offset < start:
                     return False
             pyname_filter = occurrences.PyNameFilter(pyname)
             finder = occurrences.Finder(project.pycore, name,
                                         [myfilter, pyname_filter])
-            for occurrence in finder.find_occurrences(pymodule=pymodule):
+            for occurrence in finder.find_occurrences(pymodule=module):
+                occurrence.resource = module.resource
                 return Location(occurrence)