Exemplo n.º 1
0
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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
 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")