Esempio n. 1
0
    def run(self, edit):
        reg = single_selected_region(self.view)
        rec = op.parse_import_section(self.view).record_at_or_stop(reg)

        run_command_thru_palette(self.view.window(), 'poli_rename_import', {
            'imported_as': rec.imported_as
        })
Esempio n. 2
0
    def run(self, edit, force):
        reg = single_selected_region(self.view)
        rec = op.parse_import_section(self.view).record_at_or_stop(reg)

        self.view.run_command('poli_remove_import', {
            'imported_as': rec.imported_as,
            'force': force
        })
Esempio n. 3
0
 def __init__(self, view, args, chain_tail):
     rec = op.parse_import_section(view).record_for_imported_name(
         args['imported_as']
     )
     if rec is None:
         raise RuntimeError
     disallowed_names = op.known_names(view)
     super().__init__(view, chain_tail, rec.name, disallowed_names)
Esempio n. 4
0
    def run(self, edit):
        reg = single_selected_region(self.view)

        if op.reg_import_section(self.view).contains(reg):
            impsec = op.parse_import_section(self.view)
            rec = impsec.record_at_or_stop(reg)
            op.goto_module_entry(self.view.window(), rec.module_name, rec.name)
        else:
            mtch = op.reference_at(self.view, reg)
            if mtch is None:
                sublime.status_message("No name under cursor")
                return

            star, name = mtch.group('star', 'name')
            op.goto_ref(self.view, star, name)
Esempio n. 5
0
 def __init__(self, view, args, chain_tail):
     super().__init__(view, chain_tail)
     impsec = op.parse_import_section(view)
     self.imported_names = list(impsec.imported_names())
Esempio n. 6
0
 def __init__(self, view):
     impsec = op.parse_import_section(view)
     self.items = [rec.module_name for rec in impsec.recs if rec.is_star]