Commits

Anonymous committed 0e3f9bd

interface: don't included the prefix from completions()

  • Participants
  • Parent commits 96b51a8

Comments (0)

Files changed (1)

ropemode/interface.py

 
     @decorators.local_command()
     def completions(self):
-        return _CodeAssist(self, self.env)._calculate_proposals()
+        return _CodeAssist(self, self.env).completions()
 
     def _check_autoimport(self):
         self._check_project()
         else:
             self.env.message('Global name %s not found!' % name)
 
+    def completions(self):
+        names = self._calculate_proposals()
+        prefix = self.offset - self.starting_offset
+        return [name[prefix:] for name in names]
+
     def _apply_assist(self, assist):
         if ' : ' in assist:
             name, module = assist.rsplit(' : ', 1)