Commits

Anonymous committed dd26174

interface: passing Locations instead tuples to show_occurrences()

  • Participants
  • Parent commits 05a5114

Comments (0)

Files changed (1)

File ropemode/interface.py

                 return do_find(self.project, resource, offset,
                                resources=resources, task_handle=handle, **kwds)
             result = refactor.runtask(self.env, calculate, 'Find Occurrences')
-            locations = []
-            for occurrence in result:
-                note = ''
-                if occurrence.unsure:
-                    note = '?'
-                locations.append((occurrence.resource.path,
-                                  occurrence.offset, note))
+            locations = [Location(location) for location in result]
             self.env.show_occurrences(locations)
 
     @decorators.local_command('a f', shortcut='C-c f')
         return ask_func(**ask_args)
 
 
+class Location(object):
+    def __init__(self, location):
+        self.filename = location.resource.real_path
+        self.lineno = location.lineno
+        self.offset = location.offset
+        self.note = ''
+        if location.unsure:
+            self.note = '?'
+
+
 class _CodeAssist(object):
 
     def __init__(self, interface, env):