def related_names(view): script = get_script(view, get_current_location(view)) try: related_names = script.usages() except NotFoundError: return [] return filter(lambda x: not x.in_builtin_module(), related_names)
def run(self, edit): with self.env: script = get_script(self.view, get_current_location(self.view)) try: defns = script.goto_assignments() except NotFoundError: return else: self.handle_definitions(defns)
def is_enabled(self): """ check if we can run the command """ location = get_current_location(self.view) return self.view.match_selector(location, "source.python - string - comment")