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 run(self, edit): # If we have a string, dispatch it elsewhere if check_if_string(self.view): self.view.run_command('string_go_to') return with self.env: script = get_script(self.view, get_current_location(self.view)) # If we have a possible python declaration # use jedi to find possible declarations. # found = self.attempt_get_definition(script) # if not found: # found = self.attempt_go_to(script) for method in ['get_definition', 'goto']: try: defns = getattr(script, method)() except NotFoundError: return else: self.handle_definitions(defns) break
def related_names(view): script = get_script(view, get_current_location(view)) related_names = script.related_names() return filter(lambda x: not x.in_builtin_module(), related_names)